From b3df23f7c18a148717e7c4892af3e8c4882787a0 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 11:15:41 -0700 Subject: [PATCH] Open the Sky --- engine/src/flutter/BUILD.gn | 21 + engine/src/flutter/HACKING.md | 39 + engine/src/flutter/LICENSE | 30 + engine/src/flutter/examples/README.md | 2 + engine/src/flutter/examples/radio.sky | 78 ++ engine/src/flutter/tests/TestExpectations | 9 + ...r-calls-created-synchronously-expected.txt | 5 + ...nstructor-calls-created-synchronously.html | 21 + .../document-register-basic-expected.txt | 5 + .../document-register-basic.html | 101 ++ ...er-reentrant-null-constructor-expected.txt | 2 + ...t-register-reentrant-null-constructor.html | 18 + ...ster-reentrant-returning-fake-expected.txt | 1 + ...ent-register-reentrant-returning-fake.html | 21 + ...eentrant-throwing-constructor-expected.txt | 2 + ...gister-reentrant-throwing-constructor.html | 18 + ...-upgrade-no-register-and-leak-expected.txt | 2 + .../element-upgrade-no-register-and-leak.html | 13 + ...element-type-extension-assert-expected.txt | 1 + .../html-element-type-extension-assert.html | 11 + ...eated-createElement-recursion-expected.txt | 2 + ...cycle-created-createElement-recursion.html | 10 + ...ated-createElement-reentrancy-expected.txt | 1 + ...ycle-created-createElement-reentrancy.html | 29 + ...fecycle-created-parser-script-expected.txt | 2 + .../lifecycle-created-parser-script.html | 15 + .../resources/document-register-fuzz.html | 60 + .../tests/editing/backspace-expected.txt | 1 + .../src/flutter/tests/editing/backspace.html | 20 + .../tests/editing/replace-expected.txt | 1 + engine/src/flutter/tests/editing/replace.html | 26 + .../tests/editing/selection-expected.txt | 1 + .../src/flutter/tests/editing/selection.html | 26 + .../flutter/tests/editing/typing-expected.txt | 1 + engine/src/flutter/tests/editing/typing.html | 19 + .../tests/http/conf/debian-httpd-2.2.conf | 163 +++ .../tests/http/conf/debian-httpd-2.4.conf | 148 +++ engine/src/flutter/tests/http/conf/mime.types | 601 ++++++++++ .../flutter/tests/http/conf/webkit-httpd.pem | 28 + .../tests/inspector/dom-mutation-expected.txt | 1 + ...n-modify-text-node-and-append-expected.txt | 6 + ...-mutation-modify-text-node-and-append.html | 34 + .../flutter/tests/inspector/dom-mutation.html | 37 + .../tests/lowlevel/abarth-expected.txt | 45 + engine/src/flutter/tests/lowlevel/abarth.html | 79 ++ .../attribute-collection-expected.txt | 9 + .../tests/lowlevel/attribute-collection.html | 56 + .../tests/lowlevel/camel-case-expected.txt | 5 + .../flutter/tests/lowlevel/camel-case.html | 14 + .../tests/lowlevel/createElement-expected.txt | 5 + .../flutter/tests/lowlevel/createElement.html | 112 ++ ...mplementation-create-document-expected.txt | 5 + .../dom-implementation-create-document.html | 15 + .../tests/lowlevel/hello-world-expected.txt | 7 + .../flutter/tests/lowlevel/hello-world.html | 4 + .../lowlevel/query-selector-expected.txt | 9 + .../tests/lowlevel/query-selector.html | 62 + .../tests/lowlevel/scrollbar-expected.txt | 50 + .../src/flutter/tests/lowlevel/scrollbar.html | 21 + .../tests/lowlevel/style-basic-expected.txt | 6 + .../flutter/tests/lowlevel/style-basic.html | 44 + .../lowlevel/style-specificity-expected.txt | 5 + .../tests/lowlevel/style-specificity.html | 19 + .../flutter/tests/lowlevel/text-expected.txt | 1 + engine/src/flutter/tests/lowlevel/text.html | 6 + .../tests/mocha/describe-only-expected.txt | 5 + .../flutter/tests/mocha/describe-only.html | 20 + .../flutter/tests/mocha/it-only-expected.txt | 5 + engine/src/flutter/tests/mocha/it-only.html | 18 + .../flutter/tests/modules/basic-expected.txt | 1 + engine/src/flutter/tests/modules/basic.html | 8 + .../modules/imports-can-import-expected.txt | 1 + .../tests/modules/imports-can-import.html | 7 + .../tests/modules/resources/intermediate.html | 7 + .../flutter/tests/modules/resources/pass.html | 3 + .../callback-arguments-expected.txt | 5 + .../mutation-observer/callback-arguments.html | 18 + ...ar-transient-without-delivery-expected.txt | 5 + .../clear-transient-without-delivery.html | 28 + .../create-during-delivery-expected.txt | 5 + .../create-during-delivery.html | 37 + .../cross-document-expected.txt | 6 + .../mutation-observer/cross-document.html | 49 + .../delivery-order-expected.txt | 5 + .../mutation-observer/delivery-order.html | 40 + .../disconnect-cancel-pending-expected.txt | 5 + .../disconnect-cancel-pending.html | 44 + .../document-fragment-insertion-expected.txt | 7 + .../document-fragment-insertion.html | 69 ++ .../mutate-during-delivery-expected.txt | 5 + .../mutate-during-delivery.html | 34 + ...on-callback-non-element-crash-expected.txt | 1 + .../mutation-callback-non-element-crash.html | 15 + ...mutation-observer-constructor-expected.txt | 6 + .../mutation-observer-constructor.html | 28 + .../mutation-record-constructor-expected.txt | 5 + .../mutation-record-constructor.html | 22 + .../mutation-record-nullity-expected.txt | 7 + .../mutation-record-nullity.html | 42 + .../observe-attributes-expected.txt | 19 + .../mutation-observer/observe-attributes.html | 601 ++++++++++ .../observe-characterdata-expected.txt | 10 + .../observe-characterdata.html | 229 ++++ .../observe-childList-expected.txt | 11 + .../mutation-observer/observe-childList.html | 322 ++++++ .../observe-exceptions-expected.txt | 5 + .../mutation-observer/observe-exceptions.html | 54 + .../observe-options-attributes-expected.txt | 5 + .../observe-options-attributes.html | 34 + ...bserve-options-character-data-expected.txt | 5 + .../observe-options-character-data.html | 26 + .../observe-subtree-expected.txt | 9 + .../mutation-observer/observe-subtree.html | 264 +++++ .../observer-wrapper-dropoff-transient.html | 29 + .../observer-wrapper-dropoff.html | 28 + .../script-append-expected.txt | 5 + .../mutation-observer/script-append.html | 27 + .../mutation-observer/shadow-dom-expected.txt | 5 + .../tests/mutation-observer/shadow-dom.html | 40 + .../takeRecords-expected.txt | 5 + .../tests/mutation-observer/takeRecords.html | 53 + .../mutation-observer/transient-gc-crash.html | 22 + .../weak-callback-gc-crash.html | 17 + .../tests/services/buffer-expected.txt | 1 + engine/src/flutter/tests/services/buffer.html | 9 + .../flutter/tests/services/codec-expected.txt | 1 + engine/src/flutter/tests/services/codec.html | 9 + .../flutter/tests/services/core-expected.txt | 1 + engine/src/flutter/tests/services/core.html | 9 + .../tests/services/network-expected.txt | 9 + .../src/flutter/tests/services/network.html | 49 + .../flutter/tests/services/resources/pass.txt | 1 + .../tests/styles/inline-style-expected.txt | 5 + .../flutter/tests/styles/inline-style.html | 20 + engine/src/flutter/tools/debugger/BUILD.gn | 44 + engine/src/flutter/tools/debugger/debugger.cc | 116 ++ .../src/flutter/tools/debugger/debugger.mojom | 11 + .../src/flutter/tools/debugger/focus_rules.cc | 59 + .../src/flutter/tools/debugger/focus_rules.h | 37 + .../flutter/tools/debugger/prompt/BUILD.gn | 21 + .../flutter/tools/debugger/prompt/prompt.cc | 147 +++ .../src/flutter/tools/lint_test_expectations | 37 + engine/src/flutter/tools/lint_webkitpy | 36 + .../src/flutter/tools/read_checksum_from_png | 39 + engine/src/flutter/tools/run_sky_httpd | 35 + .../src/flutter/tools/run_sky_websocketserver | 35 + engine/src/flutter/tools/skydb | 20 + engine/src/flutter/tools/test_bindings | 50 + engine/src/flutter/tools/test_perf | 40 + engine/src/flutter/tools/test_sky | 33 + engine/src/flutter/tools/test_webkitpy | 32 + engine/src/flutter/tools/tester/BUILD.gn | 30 + .../src/flutter/tools/tester/test_harness.cc | 49 + .../src/flutter/tools/tester/test_harness.h | 39 + .../tools/tester/test_observer_impl.cc | 29 + .../flutter/tools/tester/test_observer_impl.h | 37 + .../src/flutter/tools/tester/test_runner.cc | 55 + engine/src/flutter/tools/tester/test_runner.h | 44 + engine/src/flutter/tools/tester/tester.cc | 101 ++ .../third_party/PrettyPatch/PrettyPatch.rb | 1005 +++++++++++++++++ .../PrettyPatch/PrettyPatch_test.rb | 99 ++ .../tools/third_party/PrettyPatch/diff.rb | 164 +++ .../tools/third_party/PrettyPatch/prettify.rb | 37 + engine/src/flutter/tools/webkit-patch | 86 ++ 164 files changed, 7280 insertions(+) create mode 100644 engine/src/flutter/BUILD.gn create mode 100644 engine/src/flutter/HACKING.md create mode 100644 engine/src/flutter/LICENSE create mode 100644 engine/src/flutter/examples/README.md create mode 100644 engine/src/flutter/examples/radio.sky create mode 100644 engine/src/flutter/tests/TestExpectations create mode 100644 engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html create mode 100644 engine/src/flutter/tests/custom-elements/document-register-basic-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/document-register-basic.html create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor.html create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake.html create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor.html create mode 100644 engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak.html create mode 100644 engine/src/flutter/tests/custom-elements/html-element-type-extension-assert-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/html-element-type-extension-assert.html create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion.html create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy.html create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script-expected.txt create mode 100644 engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script.html create mode 100644 engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.html create mode 100644 engine/src/flutter/tests/editing/backspace-expected.txt create mode 100644 engine/src/flutter/tests/editing/backspace.html create mode 100644 engine/src/flutter/tests/editing/replace-expected.txt create mode 100644 engine/src/flutter/tests/editing/replace.html create mode 100644 engine/src/flutter/tests/editing/selection-expected.txt create mode 100644 engine/src/flutter/tests/editing/selection.html create mode 100644 engine/src/flutter/tests/editing/typing-expected.txt create mode 100644 engine/src/flutter/tests/editing/typing.html create mode 100644 engine/src/flutter/tests/http/conf/debian-httpd-2.2.conf create mode 100644 engine/src/flutter/tests/http/conf/debian-httpd-2.4.conf create mode 100644 engine/src/flutter/tests/http/conf/mime.types create mode 100644 engine/src/flutter/tests/http/conf/webkit-httpd.pem create mode 100644 engine/src/flutter/tests/inspector/dom-mutation-expected.txt create mode 100644 engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append-expected.txt create mode 100644 engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append.html create mode 100644 engine/src/flutter/tests/inspector/dom-mutation.html create mode 100644 engine/src/flutter/tests/lowlevel/abarth-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/abarth.html create mode 100644 engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/attribute-collection.html create mode 100644 engine/src/flutter/tests/lowlevel/camel-case-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/camel-case.html create mode 100644 engine/src/flutter/tests/lowlevel/createElement-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/createElement.html create mode 100644 engine/src/flutter/tests/lowlevel/dom-implementation-create-document-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/dom-implementation-create-document.html create mode 100644 engine/src/flutter/tests/lowlevel/hello-world-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/hello-world.html create mode 100644 engine/src/flutter/tests/lowlevel/query-selector-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/query-selector.html create mode 100644 engine/src/flutter/tests/lowlevel/scrollbar-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/scrollbar.html create mode 100644 engine/src/flutter/tests/lowlevel/style-basic-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/style-basic.html create mode 100644 engine/src/flutter/tests/lowlevel/style-specificity-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/style-specificity.html create mode 100644 engine/src/flutter/tests/lowlevel/text-expected.txt create mode 100644 engine/src/flutter/tests/lowlevel/text.html create mode 100644 engine/src/flutter/tests/mocha/describe-only-expected.txt create mode 100644 engine/src/flutter/tests/mocha/describe-only.html create mode 100644 engine/src/flutter/tests/mocha/it-only-expected.txt create mode 100644 engine/src/flutter/tests/mocha/it-only.html create mode 100644 engine/src/flutter/tests/modules/basic-expected.txt create mode 100644 engine/src/flutter/tests/modules/basic.html create mode 100644 engine/src/flutter/tests/modules/imports-can-import-expected.txt create mode 100644 engine/src/flutter/tests/modules/imports-can-import.html create mode 100644 engine/src/flutter/tests/modules/resources/intermediate.html create mode 100644 engine/src/flutter/tests/modules/resources/pass.html create mode 100644 engine/src/flutter/tests/mutation-observer/callback-arguments-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/callback-arguments.html create mode 100644 engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery.html create mode 100644 engine/src/flutter/tests/mutation-observer/create-during-delivery-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/create-during-delivery.html create mode 100644 engine/src/flutter/tests/mutation-observer/cross-document-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/cross-document.html create mode 100644 engine/src/flutter/tests/mutation-observer/delivery-order-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/delivery-order.html create mode 100644 engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending.html create mode 100644 engine/src/flutter/tests/mutation-observer/document-fragment-insertion-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/document-fragment-insertion.html create mode 100644 engine/src/flutter/tests/mutation-observer/mutate-during-delivery-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/mutate-during-delivery.html create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash.html create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-observer-constructor-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-observer-constructor.html create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-record-constructor-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-record-constructor.html create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-record-nullity-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/mutation-record-nullity.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-attributes.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-characterdata-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-characterdata.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-childList-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-childList.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-exceptions-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-exceptions.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-options-attributes-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-options-attributes.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-options-character-data-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-options-character-data.html create mode 100644 engine/src/flutter/tests/mutation-observer/observe-subtree-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/observe-subtree.html create mode 100644 engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff-transient.html create mode 100644 engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff.html create mode 100644 engine/src/flutter/tests/mutation-observer/script-append-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/script-append.html create mode 100644 engine/src/flutter/tests/mutation-observer/shadow-dom-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/shadow-dom.html create mode 100644 engine/src/flutter/tests/mutation-observer/takeRecords-expected.txt create mode 100644 engine/src/flutter/tests/mutation-observer/takeRecords.html create mode 100644 engine/src/flutter/tests/mutation-observer/transient-gc-crash.html create mode 100644 engine/src/flutter/tests/mutation-observer/weak-callback-gc-crash.html create mode 100644 engine/src/flutter/tests/services/buffer-expected.txt create mode 100644 engine/src/flutter/tests/services/buffer.html create mode 100644 engine/src/flutter/tests/services/codec-expected.txt create mode 100644 engine/src/flutter/tests/services/codec.html create mode 100644 engine/src/flutter/tests/services/core-expected.txt create mode 100644 engine/src/flutter/tests/services/core.html create mode 100644 engine/src/flutter/tests/services/network-expected.txt create mode 100644 engine/src/flutter/tests/services/network.html create mode 100644 engine/src/flutter/tests/services/resources/pass.txt create mode 100644 engine/src/flutter/tests/styles/inline-style-expected.txt create mode 100644 engine/src/flutter/tests/styles/inline-style.html create mode 100644 engine/src/flutter/tools/debugger/BUILD.gn create mode 100644 engine/src/flutter/tools/debugger/debugger.cc create mode 100644 engine/src/flutter/tools/debugger/debugger.mojom create mode 100644 engine/src/flutter/tools/debugger/focus_rules.cc create mode 100644 engine/src/flutter/tools/debugger/focus_rules.h create mode 100644 engine/src/flutter/tools/debugger/prompt/BUILD.gn create mode 100644 engine/src/flutter/tools/debugger/prompt/prompt.cc create mode 100755 engine/src/flutter/tools/lint_test_expectations create mode 100755 engine/src/flutter/tools/lint_webkitpy create mode 100755 engine/src/flutter/tools/read_checksum_from_png create mode 100755 engine/src/flutter/tools/run_sky_httpd create mode 100755 engine/src/flutter/tools/run_sky_websocketserver create mode 100755 engine/src/flutter/tools/skydb create mode 100755 engine/src/flutter/tools/test_bindings create mode 100755 engine/src/flutter/tools/test_perf create mode 100755 engine/src/flutter/tools/test_sky create mode 100755 engine/src/flutter/tools/test_webkitpy create mode 100644 engine/src/flutter/tools/tester/BUILD.gn create mode 100644 engine/src/flutter/tools/tester/test_harness.cc create mode 100644 engine/src/flutter/tools/tester/test_harness.h create mode 100644 engine/src/flutter/tools/tester/test_observer_impl.cc create mode 100644 engine/src/flutter/tools/tester/test_observer_impl.h create mode 100644 engine/src/flutter/tools/tester/test_runner.cc create mode 100644 engine/src/flutter/tools/tester/test_runner.h create mode 100644 engine/src/flutter/tools/tester/tester.cc create mode 100644 engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch.rb create mode 100755 engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch_test.rb create mode 100644 engine/src/flutter/tools/third_party/PrettyPatch/diff.rb create mode 100755 engine/src/flutter/tools/third_party/PrettyPatch/prettify.rb create mode 100755 engine/src/flutter/tools/webkit-patch diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn new file mode 100644 index 0000000000..c496af3d9d --- /dev/null +++ b/engine/src/flutter/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +group("sky") { + testonly = true + + deps = [ + "//mojo", + "//sky/engine/platform:platform_unittests", + "//sky/engine/web:sky_unittests", + "//sky/engine/wtf:unittests", + "//sky/framework/inspector/server", + "//sky/tools/debugger", + "//sky/tools/tester", + "//sky/viewer", + "//third_party/mesa:osmesa", + ] +} diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md new file mode 100644 index 0000000000..51b99d98a3 --- /dev/null +++ b/engine/src/flutter/HACKING.md @@ -0,0 +1,39 @@ +Hacking on Sky +============== + +Running applications +-------------------- + +* ``./sky/tools/skydb --debug`` + * You should see a ``(skydb)`` prompt + * Type ``help`` to see the list of available commands + * The most common command is to load a URL, which youc an do simply by typing + the URL. To reload the current page, type enter. + +* ``./sky/tools/test_sky --debug`` + * This should run the tests + +Running tests manually +---------------------------- + + * ``sky/tools/run_sky_httpd`` + * ``out/Debug/mojo_shell --args-for="mojo://native_viewport_service/ --use-headless-config" --content-handlers=text/html,mojo://sky_viewer/ --url-mappings=mojo:window_manager=mojo:sky_tester mojo:window_manager`` + * The ``sky_tester`` should print ``#READY`` when ready + * Type the URL you wish to run, for example ``http://127.0.0.1:8000/lowlevel/text.html``, and press the enter key + * The harness should print the results of the test. You can then type another URL. + +Writing tests +------------- + +* Import ``tests/http/tests/resources/mocha.html`` +* Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-started) and use [chai asserts](http://chaijs.com/api/assert/): +``` +describe('My pretty test of my subject', function() { + var subject = new MySubject(); + + it('should be pretty', function() { + assert.ok(subject.isPretty); + }); + +}); +``` diff --git a/engine/src/flutter/LICENSE b/engine/src/flutter/LICENSE new file mode 100644 index 0000000000..70bcb8ad11 --- /dev/null +++ b/engine/src/flutter/LICENSE @@ -0,0 +1,30 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// +// The Chromium Authors can be found at +// http://src.chromium.org/svn/trunk/src/AUTHORS +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/engine/src/flutter/examples/README.md b/engine/src/flutter/examples/README.md new file mode 100644 index 0000000000..b027ed52f4 --- /dev/null +++ b/engine/src/flutter/examples/README.md @@ -0,0 +1,2 @@ +These are work-in-progress examples of how the language might look. +They won't currently work. diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky new file mode 100644 index 0000000000..0cd15d04ff --- /dev/null +++ b/engine/src/flutter/examples/radio.sky @@ -0,0 +1,78 @@ +SKY MODULE - radio button and radio button group + + + + + + + + + + diff --git a/engine/src/flutter/tests/TestExpectations b/engine/src/flutter/tests/TestExpectations new file mode 100644 index 0000000000..fdd431e6c5 --- /dev/null +++ b/engine/src/flutter/tests/TestExpectations @@ -0,0 +1,9 @@ + +# These tests rely upon eventSender, which isn't implemented yet. +crbug.com/1 editing/ [ Skip ] + +# These tests require gc() to be exposed. +crbug.com/1 mutation-observer/observer-wrapper-dropoff-transient.html [ Skip ] +crbug.com/1 mutation-observer/observer-wrapper-dropoff.html [ Skip ] +crbug.com/1 mutation-observer/transient-gc-crash.html [ Skip ] +crbug.com/1 mutation-observer/weak-callback-gc-crash.html [ Skip ] diff --git a/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously-expected.txt b/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously-expected.txt new file mode 100644 index 0000000000..affd6723ed --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Custom element constructors should run the createdCallback synchronously +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html b/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html new file mode 100644 index 0000000000..067ada4143 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html @@ -0,0 +1,21 @@ + + + + +
+ + + diff --git a/engine/src/flutter/tests/custom-elements/document-register-basic-expected.txt b/engine/src/flutter/tests/custom-elements/document-register-basic-expected.txt new file mode 100644 index 0000000000..2b979afdc8 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-basic-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 document.registerElement() should have basic behaviors +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/custom-elements/document-register-basic.html b/engine/src/flutter/tests/custom-elements/document-register-basic.html new file mode 100644 index 0000000000..faeb7af5c5 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-basic.html @@ -0,0 +1,101 @@ + + + + +
+ + + diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor-expected.txt b/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor-expected.txt new file mode 100644 index 0000000000..d583723293 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor-expected.txt @@ -0,0 +1,2 @@ +CONSOLE: LOG: Constructor object isn't created. +Fuzzing document.registerElement() through getters. PASS unless crash. diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor.html b/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor.html new file mode 100644 index 0000000000..822ebe74de --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-null-constructor.html @@ -0,0 +1,18 @@ + + + + +
+Fuzzing document.registerElement() through getters. PASS unless crash. + + + diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake-expected.txt b/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake-expected.txt new file mode 100644 index 0000000000..6a159f7199 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake-expected.txt @@ -0,0 +1 @@ +Fuzzing document.registerElement() through getters. PASS uless crash. diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake.html b/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake.html new file mode 100644 index 0000000000..0447914912 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-returning-fake.html @@ -0,0 +1,21 @@ + + + + +
+Fuzzing document.registerElement() through getters. PASS uless crash. + + + diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor-expected.txt b/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor-expected.txt new file mode 100644 index 0000000000..d583723293 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor-expected.txt @@ -0,0 +1,2 @@ +CONSOLE: LOG: Constructor object isn't created. +Fuzzing document.registerElement() through getters. PASS unless crash. diff --git a/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor.html b/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor.html new file mode 100644 index 0000000000..513020e858 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/document-register-reentrant-throwing-constructor.html @@ -0,0 +1,18 @@ + + + + +
+Fuzzing document.registerElement() through getters. PASS unless crash. + + + diff --git a/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak-expected.txt b/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak-expected.txt new file mode 100644 index 0000000000..32ca4b58ed --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak-expected.txt @@ -0,0 +1,2 @@ +Tests unresolved element not leaking if never resolved. + diff --git a/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak.html b/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak.html new file mode 100644 index 0000000000..afb7fd0ec6 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/element-upgrade-no-register-and-leak.html @@ -0,0 +1,13 @@ + + + +Tests unresolved element not leaking if never resolved. +
+ + + diff --git a/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert-expected.txt b/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert-expected.txt new file mode 100644 index 0000000000..5712a16936 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert-expected.txt @@ -0,0 +1 @@ +Tests that type extension of a element whose DOM interface is HTMLElement does not assert diff --git a/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert.html b/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert.html new file mode 100644 index 0000000000..1e7feb7d5f --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/html-element-type-extension-assert.html @@ -0,0 +1,11 @@ + + + +
+Tests that type extension of a element whose DOM interface is HTMLElement does not assert + + + diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion-expected.txt b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion-expected.txt new file mode 100644 index 0000000000..1a143ed11e --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion-expected.txt @@ -0,0 +1,2 @@ +CONSOLE: LOG: PASS unless crash + diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion.html b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion.html new file mode 100644 index 0000000000..2e0caa06a9 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-recursion.html @@ -0,0 +1,10 @@ + + + + + + diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy-expected.txt b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy-expected.txt new file mode 100644 index 0000000000..f0e1695908 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy-expected.txt @@ -0,0 +1 @@ +This test ensures that is visible in following script block. diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy.html b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy.html new file mode 100644 index 0000000000..12fcab126a --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-createElement-reentrancy.html @@ -0,0 +1,29 @@ + + + + +This test ensures that is visible in following script block. + + + + diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script-expected.txt b/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script-expected.txt new file mode 100644 index 0000000000..4e962ea021 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script-expected.txt @@ -0,0 +1,2 @@ +This test ensures that the lifecycle callback of a parser-made element is visible in following script block. + diff --git a/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script.html b/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script.html new file mode 100644 index 0000000000..76f04d3ab8 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/lifecycle-created-parser-script.html @@ -0,0 +1,15 @@ + + + + +This test ensures that the lifecycle callback of a parser-made element is visible in following script block. + + + + + diff --git a/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.html b/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.html new file mode 100644 index 0000000000..bf6c66a689 --- /dev/null +++ b/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.html @@ -0,0 +1,60 @@ + diff --git a/engine/src/flutter/tests/editing/backspace-expected.txt b/engine/src/flutter/tests/editing/backspace-expected.txt new file mode 100644 index 0000000000..7898192261 --- /dev/null +++ b/engine/src/flutter/tests/editing/backspace-expected.txt @@ -0,0 +1 @@ +a diff --git a/engine/src/flutter/tests/editing/backspace.html b/engine/src/flutter/tests/editing/backspace.html new file mode 100644 index 0000000000..3a894ca26c --- /dev/null +++ b/engine/src/flutter/tests/editing/backspace.html @@ -0,0 +1,20 @@ + + +
+ + diff --git a/engine/src/flutter/tests/editing/replace-expected.txt b/engine/src/flutter/tests/editing/replace-expected.txt new file mode 100644 index 0000000000..2bc457f6ca --- /dev/null +++ b/engine/src/flutter/tests/editing/replace-expected.txt @@ -0,0 +1 @@ +abx diff --git a/engine/src/flutter/tests/editing/replace.html b/engine/src/flutter/tests/editing/replace.html new file mode 100644 index 0000000000..767c9a7b2c --- /dev/null +++ b/engine/src/flutter/tests/editing/replace.html @@ -0,0 +1,26 @@ + + +
+ + diff --git a/engine/src/flutter/tests/editing/selection-expected.txt b/engine/src/flutter/tests/editing/selection-expected.txt new file mode 100644 index 0000000000..81bf396956 --- /dev/null +++ b/engine/src/flutter/tests/editing/selection-expected.txt @@ -0,0 +1 @@ +ab diff --git a/engine/src/flutter/tests/editing/selection.html b/engine/src/flutter/tests/editing/selection.html new file mode 100644 index 0000000000..7a67326e0b --- /dev/null +++ b/engine/src/flutter/tests/editing/selection.html @@ -0,0 +1,26 @@ + + +
+ + diff --git a/engine/src/flutter/tests/editing/typing-expected.txt b/engine/src/flutter/tests/editing/typing-expected.txt new file mode 100644 index 0000000000..81bf396956 --- /dev/null +++ b/engine/src/flutter/tests/editing/typing-expected.txt @@ -0,0 +1 @@ +ab diff --git a/engine/src/flutter/tests/editing/typing.html b/engine/src/flutter/tests/editing/typing.html new file mode 100644 index 0000000000..1b3e169d77 --- /dev/null +++ b/engine/src/flutter/tests/editing/typing.html @@ -0,0 +1,19 @@ + + +
+ + diff --git a/engine/src/flutter/tests/http/conf/debian-httpd-2.2.conf b/engine/src/flutter/tests/http/conf/debian-httpd-2.2.conf new file mode 100644 index 0000000000..fa4209bb6c --- /dev/null +++ b/engine/src/flutter/tests/http/conf/debian-httpd-2.2.conf @@ -0,0 +1,163 @@ +ServerRoot "/usr" + +LockFile "/tmp/WebKit/httpd.lock" +PidFile "/tmp/WebKit/httpd.pid" +ScoreBoardFile "/tmp/WebKit/httpd.scoreboard" + +Timeout 300 +KeepAlive On +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 + +MinSpareServers 1 +MaxSpareServers 5 +StartServers 1 +MaxClients 150 +MaxRequestsPerChild 100000 + +LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so +LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so +LoadModule include_module /usr/lib/apache2/modules/mod_include.so +LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so +LoadModule asis_module /usr/lib/apache2/modules/mod_asis.so +LoadModule imagemap_module /usr/lib/apache2/modules/mod_imagemap.so +LoadModule actions_module /usr/lib/apache2/modules/mod_actions.so +LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so +LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so +LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so +LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so +LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so +LoadModule php5_module /usr/lib/apache2/modules/libphp5.so +LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so + +ServerName 127.0.0.1 + + + Options Indexes FollowSymLinks MultiViews ExecCGI Includes + AllowOverride All + Order allow,deny + Allow from all + + +AccessFileName .htaccess + + + Order allow,deny + Deny from all + Satisfy All + + +UseCanonicalName On +DefaultType text/plain +HostnameLookups Off + +LogLevel warn +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %b" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent + +ServerSignature On + + + + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Wed, 13 Jul 1972 03:00:00 GMT" + + + + AddLanguage da .dk + AddLanguage nl .nl + AddLanguage en .en + AddLanguage et .ee + AddLanguage fr .fr + AddLanguage de .de + AddLanguage el .el + AddLanguage he .he + AddCharset ISO-8859-8 .iso8859-8 + AddLanguage it .it + AddLanguage ja .ja + AddCharset ISO-2022-JP .jis + AddLanguage kr .kr + AddCharset ISO-2022-KR .iso-kr + AddLanguage nn .nn + AddLanguage no .no + AddLanguage pl .po + AddCharset ISO-8859-2 .iso-pl + AddLanguage pt .pt + AddLanguage pt-br .pt-br + AddLanguage ltz .lu + AddLanguage ca .ca + AddLanguage es .es + AddLanguage sv .sv + AddLanguage cs .cz .cs + AddLanguage ru .ru + AddLanguage zh-TW .zh-tw + AddCharset Big5 .Big5 .big5 + AddCharset WINDOWS-1251 .cp-1251 + AddCharset CP866 .cp866 + AddCharset ISO-8859-5 .iso-ru + AddCharset KOI8-R .koi8-r + AddCharset UCS-2 .ucs2 + AddCharset UCS-4 .ucs4 + AddCharset UTF-8 .utf8 + + + LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw + + + AddType application/x-tar .tgz + + AddEncoding x-compress .Z + AddEncoding x-gzip .gz .tgz + + AddHandler cgi-script .cgi .pl + + AddType text/html .shtml + AddHandler server-parsed .shtml + + AddHandler send-as-is asis + + + + AddType application/x-httpd-php .php + AddType application/x-httpd-php .bat + AddType application/x-httpd-php-source .phps + + + DirectoryIndex index.html index.php + + + php_flag log_errors on + php_flag short_open_tag on + + + + RewriteEngine On + RewriteCond %{REQUEST_METHOD} ^TRACE + RewriteRule .* - [F] + + + + ServerName 127.0.0.1 + SSLEngine On + + +# +# Apple-specific filesystem protection. +# + + Order allow,deny + Deny from all + Satisfy All + + + + Order allow,deny + Deny from all + Satisfy All + diff --git a/engine/src/flutter/tests/http/conf/debian-httpd-2.4.conf b/engine/src/flutter/tests/http/conf/debian-httpd-2.4.conf new file mode 100644 index 0000000000..22a9b46505 --- /dev/null +++ b/engine/src/flutter/tests/http/conf/debian-httpd-2.4.conf @@ -0,0 +1,148 @@ +ServerTokens OS +ServerRoot "/usr/lib/apache2" + +PidFile "/tmp/WebKit/httpd.pid" +ScoreBoardFile "/tmp/WebKit/httpd.scoreboard" + +Timeout 300 +KeepAlive On +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 + +MinSpareServers 1 +MaxSpareServers 5 +StartServers 1 +MaxClients 150 +MaxRequestsPerChild 100000 + +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule include_module modules/mod_include.so +LoadModule headers_module modules/mod_headers.so +LoadModule mime_module modules/mod_mime.so +LoadModule negotiation_module modules/mod_negotiation.so +LoadModule actions_module modules/mod_actions.so +LoadModule alias_module modules/mod_alias.so +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule cgi_module modules/mod_cgi.so +LoadModule ssl_module modules/mod_ssl.so +LoadModule php5_module modules/libphp5.so +LoadModule asis_module modules/mod_asis.so + +ServerName 127.0.0.1 + + + Options Indexes FollowSymLinks MultiViews ExecCGI Includes + AllowOverride All + Require all granted + + +AccessFileName .htaccess + + + Require all denied + + +UseCanonicalName On +HostnameLookups Off + +TypesConfig /etc/mime.types + +LogLevel warn +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %b" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent +ErrorLog /tmp/WebKit/error_log + +ServerSignature On + +AddLanguage ca .ca +AddLanguage cs .cz .cs +AddLanguage da .dk +AddLanguage de .de +AddLanguage el .el +AddLanguage en .en +AddLanguage eo .eo +AddLanguage es .es +AddLanguage et .et +AddLanguage fr .fr +AddLanguage he .he +AddLanguage hr .hr +AddLanguage it .it +AddLanguage ja .ja +AddLanguage ko .ko +AddLanguage ltz .ltz +AddLanguage nl .nl +AddLanguage nn .nn +AddLanguage no .no +AddLanguage pl .po +AddLanguage pt .pt +AddLanguage pt-BR .pt-br +AddLanguage ru .ru +AddLanguage sv .sv +AddLanguage zh-CN .zh-cn +AddLanguage zh-TW .zh-tw +AddCharset Big5 .Big5 .big5 +AddCharset WINDOWS-1251 .cp-1251 +AddCharset CP866 .cp866 +AddCharset ISO-8859-5 .iso-ru +AddCharset KOI8-R .koi8-r +AddCharset UCS-2 .ucs2 +AddCharset UCS-4 .ucs4 +AddCharset UTF-8 .utf8 + + + LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW + + +AddType application/x-tar .tgz + +AddEncoding x-compress .Z +AddEncoding x-gzip .gz .tgz + +AddType application/x-x509-ca-cert .crt +AddType application/x-pkcs7-crl .crl + +AddHandler cgi-script .cgi .pl + +AddType text/html .shtml +AddOutputFilter INCLUDES .shtml + +AddHandler send-as-is asis + + + AddType application/x-httpd-php .php + AddType application/x-httpd-php .bat + AddType application/x-httpd-php-source .phps + + + DirectoryIndex index.html index.php + + + php_flag log_errors on + php_flag short_open_tag on + + + + RewriteEngine On + RewriteCond %{REQUEST_METHOD} ^TRACE + RewriteRule .* - [F] + + + + ServerName 127.0.0.1 + SSLEngine On + + +# +# Apple-specific filesystem protection. +# + + Require all denied + + + + Require all denied + diff --git a/engine/src/flutter/tests/http/conf/mime.types b/engine/src/flutter/tests/http/conf/mime.types new file mode 100644 index 0000000000..0489350e18 --- /dev/null +++ b/engine/src/flutter/tests/http/conf/mime.types @@ -0,0 +1,601 @@ +# This is a comment. I love comments. + +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.rn-realmedia rm +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.xhtml+xml xhtmlmp +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-java-jnlp-file jnlp +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm m4a m4p +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/jp2 jp2 +image/naplps +image/pict pict pic pct +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-macpaint pntg pnt mac +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-quicktime qtif qti +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/cache-manifest manifest +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4 mp4 +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-dv dv dif +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/engine/src/flutter/tests/http/conf/webkit-httpd.pem b/engine/src/flutter/tests/http/conf/webkit-httpd.pem new file mode 100644 index 0000000000..37893b84fc --- /dev/null +++ b/engine/src/flutter/tests/http/conf/webkit-httpd.pem @@ -0,0 +1,28 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCmcXbusrr8zQr8snIb0OVQibVfgv7zPjh/5xdcrKOejJzp3epA +AF4TITeFR9vzWIwkmkcRoY+IbQNhh7kefGUYD47bvVamJMtq5cGYVs0HngT+KTMa +NGH/G44KkFIOaz/b5d/JNKONrlqwxqXS+m6IY4l/E1Ff25ZjND5TaEvI1wIDAQAB +AoGBAIcDv4A9h6UOBv2ZGyspNvsv2erSblGOhXJrWO4aNNemJJspIp4sLiPCbDE3 +a1po17XRWBkbPz1hgL6axDXQnoeo++ebfrvRSed+Fys4+6SvuSrPOv6PmWTBT/Wa +GpO+tv48JUNxC/Dy8ROixBXOViuIBEFq3NfVH4HU3+RG20NhAkEA1L3RAhdfPkLI +82luSOYE3Eq44lICb/yZi+JEihwSeZTJKdZHwYD8KVCjOtjGrOmyEyvThrcIACQz +JLEreVh33wJBAMhJm9pzJJNkIyBgiXA66FAwbhdDzSTPx0OBjoVWoj6u7jzGvIFT +Cn1aiTBYzzsiMCaCx+W3e6pK/DcvHSwKrgkCQHZMcxwBmSHLC2lnmD8LQWqqVnLr +fZV+VnfVw501DQT0uoP8NvygWBg1Uf9YKepfLXnBpidEQjup5ZKivnUEv+sCQA8N +6VcMHI2vkyxV1T7ITrnoSf4ZrIu9yl56mHnRPzSy9VlAHt8hnMI7UeB+bGUndrMO +VXQgzHzKUhbbxbePvfECQQDTtkOuhJyKDfHCxLDcwNpi+T6OWTEfCw/cq9ZWDbA7 +yCX81pQxfZkfMIS1YFIOGHovK0rMMTraCe+iDNYtVz/L +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIB9zCCAWACCQDjWWTeC6BQvTANBgkqhkiG9w0BAQQFADBAMQswCQYDVQQGEwJB +VTETMBEGA1UECBMKU29tZS1TdGF0ZTEcMBoGA1UEChMTV2ViS2l0IExheW91dCBU +ZXN0czAeFw0wNzA3MTMxMjUxMzJaFw03MTA1MTMwNjIzMTZaMEAxCzAJBgNVBAYT +AkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMRwwGgYDVQQKExNXZWJLaXQgTGF5b3V0 +IFRlc3RzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmcXbusrr8zQr8snIb +0OVQibVfgv7zPjh/5xdcrKOejJzp3epAAF4TITeFR9vzWIwkmkcRoY+IbQNhh7ke +fGUYD47bvVamJMtq5cGYVs0HngT+KTMaNGH/G44KkFIOaz/b5d/JNKONrlqwxqXS ++m6IY4l/E1Ff25ZjND5TaEvI1wIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAAfbUbgD +01O8DoZA02c1MUMbMHRPSb/qdok2pyWoCPa/BSaOIaNPePc8auPRbrS2XsVWSMft +CTXiXmrK2Xx1+fJuZLAp0CUng4De4cDH5c8nvlocYmXo+1x53S9DfD0KPryjBRI7 +9LnJq2ysHAUawiqFXlwBag6mXawD8YjzcYat +-----END CERTIFICATE----- diff --git a/engine/src/flutter/tests/inspector/dom-mutation-expected.txt b/engine/src/flutter/tests/inspector/dom-mutation-expected.txt new file mode 100644 index 0000000000..76f5a5a5aa --- /dev/null +++ b/engine/src/flutter/tests/inspector/dom-mutation-expected.txt @@ -0,0 +1 @@ +Done! diff --git a/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append-expected.txt b/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append-expected.txt new file mode 100644 index 0000000000..52eaf21c30 --- /dev/null +++ b/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append-expected.txt @@ -0,0 +1,6 @@ +CONSOLE: LOG: DOM.childNodeInserted +CONSOLE: LOG: 2 +CONSOLE: LOG: 3 +CONSOLE: LOG: DOM.childNodeInserted +CONSOLE: LOG: 3 +adding diff --git a/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append.html b/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append.html new file mode 100644 index 0000000000..a2f0d76ce7 --- /dev/null +++ b/engine/src/flutter/tests/inspector/dom-mutation-modify-text-node-and-append.html @@ -0,0 +1,34 @@ + + +
+ + diff --git a/engine/src/flutter/tests/inspector/dom-mutation.html b/engine/src/flutter/tests/inspector/dom-mutation.html new file mode 100644 index 0000000000..94350fbd50 --- /dev/null +++ b/engine/src/flutter/tests/inspector/dom-mutation.html @@ -0,0 +1,37 @@ + + + +
+ + + diff --git a/engine/src/flutter/tests/lowlevel/abarth-expected.txt b/engine/src/flutter/tests/lowlevel/abarth-expected.txt new file mode 100644 index 0000000000..861da9caf1 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/abarth-expected.txt @@ -0,0 +1,45 @@ +layer at (0,0) size 800x600 + RenderView {#document} at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderBlock {html} at (0,0) size 800x600 + RenderBlock {head} at (0,0) size 800x0 + RenderBlock {body} at (0,0) size 800x600 [bgcolor=#FFFFFF] + RenderBlock {div} at (0,0) size 800x265 + RenderBlock {div} at (0,0) size 800x115 + RenderBlock {div} at (15,15) size 770x49 + RenderInline {a} at (0,0) size 242x48 [color=#333333] + RenderText {#text} at (528,0) size 242x48 + text run at (528,0) width 242: "Adam Barth" + RenderBlock {div} at (15,64) size 770x36 + RenderBlock {div} at (0,0) size 770x18 + RenderText {#text} at (574,0) size 196x17 + text run at (574,0) width 196: "Ph.D., M.S., Stanford, 2008" + RenderBlock {div} at (0,18) size 770x18 + RenderText {#text} at (635,0) size 135x17 + text run at (635,0) width 135: "B.A., Cornell, 2003" + RenderBlock {div} at (0,115) size 800x150 + RenderBlock {div} at (0,19) size 800x28 + RenderInline {a} at (0,0) size 93x17 [color=#333333] + RenderText {#text} at (692,5) size 93x17 + text run at (692,5) width 93: "@adambarth" + RenderBlock {div} at (0,47) size 800x28 + RenderInline {a} at (0,0) size 35x17 [color=#333333] + RenderText {#text} at (750,5) size 35x17 + text run at (750,5) width 35: "Blink" + RenderBlock {div} at (0,75) size 800x28 + RenderInline {a} at (0,0) size 74x17 [color=#333333] + RenderText {#text} at (711,5) size 74x17 + text run at (711,5) width 74: "Chromium" + RenderBlock {div} at (0,103) size 800x28 + RenderInline {a} at (0,0) size 87x17 [color=#333333] + RenderText {#text} at (698,5) size 87x17 + text run at (698,5) width 87: "Publications" +layer at (686,582) size 114x18 + RenderBlock (positioned) {div} at (686.19,582) size 113.81x18 [color=#333333] + RenderText {#text} at (3,3) size 73x12 + text run at (3,3) width 73: "Photograph by " + RenderInline {a} at (0,0) size 36x12 + RenderText {#text} at (75,3) size 36x12 + text run at (75,3) width 36: "J\x{E9}r\x{F4}me" + RenderText {#text} at (0,0) size 0x0 + diff --git a/engine/src/flutter/tests/lowlevel/abarth.html b/engine/src/flutter/tests/lowlevel/abarth.html new file mode 100644 index 0000000000..a6aff7c7fd --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/abarth.html @@ -0,0 +1,79 @@ + + + + +Adam Barth + + + +
+
+ +
+
Ph.D., M.S., Stanford, 2008
+
B.A., Cornell, 2003
+
+
+ +
+
+Photograph by Jérôme +
+ + diff --git a/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt b/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt new file mode 100644 index 0000000000..7ddea59e80 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt @@ -0,0 +1,9 @@ +Running 5 tests +ok 1 Attribute collection should get by index +ok 2 Attribute collection should get by name +ok 3 Attribute collection should set by name +ok 4 Attribute collection should be case sensitive +ok 5 Attribute collection should live update +5 tests +5 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/attribute-collection.html b/engine/src/flutter/tests/lowlevel/attribute-collection.html new file mode 100644 index 0000000000..40d940b7f8 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/attribute-collection.html @@ -0,0 +1,56 @@ + + + + + diff --git a/engine/src/flutter/tests/lowlevel/camel-case-expected.txt b/engine/src/flutter/tests/lowlevel/camel-case-expected.txt new file mode 100644 index 0000000000..e946e5eef6 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/camel-case-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Element tag names should have various casing +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/camel-case.html b/engine/src/flutter/tests/lowlevel/camel-case.html new file mode 100644 index 0000000000..9b414851c4 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/camel-case.html @@ -0,0 +1,14 @@ + + + + + diff --git a/engine/src/flutter/tests/lowlevel/createElement-expected.txt b/engine/src/flutter/tests/lowlevel/createElement-expected.txt new file mode 100644 index 0000000000..ca2b119a20 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/createElement-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 createElementNS tests from mozilla, attached to webkit bug 16833 should behave like mozilla +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/createElement.html b/engine/src/flutter/tests/lowlevel/createElement.html new file mode 100644 index 0000000000..9cd83e0044 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/createElement.html @@ -0,0 +1,112 @@ + + + + + diff --git a/engine/src/flutter/tests/lowlevel/dom-implementation-create-document-expected.txt b/engine/src/flutter/tests/lowlevel/dom-implementation-create-document-expected.txt new file mode 100644 index 0000000000..7f855a124a --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/dom-implementation-create-document-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 DOMImplementation should let you create a document +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/dom-implementation-create-document.html b/engine/src/flutter/tests/lowlevel/dom-implementation-create-document.html new file mode 100644 index 0000000000..6e3a46feeb --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/dom-implementation-create-document.html @@ -0,0 +1,15 @@ + + + + + diff --git a/engine/src/flutter/tests/lowlevel/hello-world-expected.txt b/engine/src/flutter/tests/lowlevel/hello-world-expected.txt new file mode 100644 index 0000000000..99b828639c --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/hello-world-expected.txt @@ -0,0 +1,7 @@ +layer at (0,0) size 800x600 + RenderView {#document} at (0,0) size 800x600 +layer at (0,0) size 800x19 + RenderBlock {foo} at (0,0) size 800x19 + RenderText {#text} at (0,0) size 99x19 + text run at (0,0) width 99: "Hello World!" + diff --git a/engine/src/flutter/tests/lowlevel/hello-world.html b/engine/src/flutter/tests/lowlevel/hello-world.html new file mode 100644 index 0000000000..a3fa084588 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/hello-world.html @@ -0,0 +1,4 @@ + + +Hello World! + diff --git a/engine/src/flutter/tests/lowlevel/query-selector-expected.txt b/engine/src/flutter/tests/lowlevel/query-selector-expected.txt new file mode 100644 index 0000000000..7acef635a0 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/query-selector-expected.txt @@ -0,0 +1,9 @@ +Running 5 tests +ok 1 querySelector should find elements by class name +ok 2 querySelector should find elements by id +ok 3 querySelector should find elements by tag name +ok 4 querySelector should find an element by compound selector +ok 5 querySelector should find all elements by compound selector +5 tests +5 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/query-selector.html b/engine/src/flutter/tests/lowlevel/query-selector.html new file mode 100644 index 0000000000..a216a8cf49 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/query-selector.html @@ -0,0 +1,62 @@ + + + +
+
+
+
+ + + + + +
+ + + +
+ + diff --git a/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt b/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt new file mode 100644 index 0000000000..2d082379c4 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt @@ -0,0 +1,50 @@ +layer at (0,0) size 800x1500 + RenderView {#document} at (0,0) size 800x600 +layer at (0,0) size 800x1500 + RenderBlock {html} at (0,0) size 800x1500 [bgcolor=#FFC0CB] + RenderBlock {div} at (0,0) size 800x100 + RenderText {#text} at (0,0) size 10x19 + text run at (0,0) width 10: "a" + RenderBlock {div} at (0,100) size 800x100 + RenderText {#text} at (0,0) size 11x19 + text run at (0,0) width 11: "b" + RenderBlock {div} at (0,200) size 800x100 + RenderText {#text} at (0,0) size 9x19 + text run at (0,0) width 9: "c" + RenderBlock {div} at (0,300) size 800x100 + RenderText {#text} at (0,0) size 11x19 + text run at (0,0) width 11: "d" + RenderBlock {div} at (0,400) size 800x100 + RenderText {#text} at (0,0) size 10x19 + text run at (0,0) width 10: "e" + RenderBlock {div} at (0,500) size 800x100 + RenderText {#text} at (0,0) size 6x19 + text run at (0,0) width 6: "f" + RenderBlock {div} at (0,600) size 800x100 + RenderText {#text} at (0,0) size 11x19 + text run at (0,0) width 11: "g" + RenderBlock {div} at (0,700) size 800x100 + RenderText {#text} at (0,0) size 11x19 + text run at (0,0) width 11: "h" + RenderBlock {div} at (0,800) size 800x100 + RenderText {#text} at (0,0) size 5x19 + text run at (0,0) width 5: "i" + RenderBlock {div} at (0,900) size 800x100 + RenderText {#text} at (0,0) size 5x19 + text run at (0,0) width 5: "j" + RenderBlock {div} at (0,1000) size 800x100 + RenderText {#text} at (0,0) size 10x19 + text run at (0,0) width 10: "k" + RenderBlock {div} at (0,1100) size 800x100 + RenderText {#text} at (0,0) size 5x19 + text run at (0,0) width 5: "l" + RenderBlock {div} at (0,1200) size 800x100 + RenderText {#text} at (0,0) size 16x19 + text run at (0,0) width 16: "m" + RenderBlock {div} at (0,1300) size 800x100 + RenderText {#text} at (0,0) size 11x19 + text run at (0,0) width 11: "n" + RenderBlock {div} at (0,1400) size 800x100 + RenderText {#text} at (0,0) size 10x19 + text run at (0,0) width 10: "o" + diff --git a/engine/src/flutter/tests/lowlevel/scrollbar.html b/engine/src/flutter/tests/lowlevel/scrollbar.html new file mode 100644 index 0000000000..3e230d41e7 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/scrollbar.html @@ -0,0 +1,21 @@ + + + +
a
+
b
+
c
+
d
+
e
+
f
+
g
+
h
+
i
+
j
+
k
+
l
+
m
+
n
+
o
+ diff --git a/engine/src/flutter/tests/lowlevel/style-basic-expected.txt b/engine/src/flutter/tests/lowlevel/style-basic-expected.txt new file mode 100644 index 0000000000..ad806cfe0c --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/style-basic-expected.txt @@ -0,0 +1,6 @@ +PASS:
order was 1 +PASS:
order was 2 +PASS: order was 3 +PASS:
order was 4 +PASS:
order was 5 +PASS: order was 6 diff --git a/engine/src/flutter/tests/lowlevel/style-basic.html b/engine/src/flutter/tests/lowlevel/style-basic.html new file mode 100644 index 0000000000..5b9d2d162c --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/style-basic.html @@ -0,0 +1,44 @@ + + + + + +
+
+
+ +
+
+ +
+
+ + + diff --git a/engine/src/flutter/tests/lowlevel/style-specificity-expected.txt b/engine/src/flutter/tests/lowlevel/style-specificity-expected.txt new file mode 100644 index 0000000000..c76ebf2e30 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/style-specificity-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Specificity should not exist +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/style-specificity.html b/engine/src/flutter/tests/lowlevel/style-specificity.html new file mode 100644 index 0000000000..7821b9ee94 --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/style-specificity.html @@ -0,0 +1,19 @@ + + + + + +
This should be blue.
+ + + diff --git a/engine/src/flutter/tests/lowlevel/text-expected.txt b/engine/src/flutter/tests/lowlevel/text-expected.txt new file mode 100644 index 0000000000..fcde0b743f --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/text-expected.txt @@ -0,0 +1 @@ +This is a dump-as-text test. diff --git a/engine/src/flutter/tests/lowlevel/text.html b/engine/src/flutter/tests/lowlevel/text.html new file mode 100644 index 0000000000..f1a75bf65d --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/text.html @@ -0,0 +1,6 @@ + + + +This is a dump-as-text test. + + diff --git a/engine/src/flutter/tests/mocha/describe-only-expected.txt b/engine/src/flutter/tests/mocha/describe-only-expected.txt new file mode 100644 index 0000000000..44a7b54fe1 --- /dev/null +++ b/engine/src/flutter/tests/mocha/describe-only-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 This suite should run this test +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mocha/describe-only.html b/engine/src/flutter/tests/mocha/describe-only.html new file mode 100644 index 0000000000..68f686fdf7 --- /dev/null +++ b/engine/src/flutter/tests/mocha/describe-only.html @@ -0,0 +1,20 @@ + + + + + diff --git a/engine/src/flutter/tests/mocha/it-only-expected.txt b/engine/src/flutter/tests/mocha/it-only-expected.txt new file mode 100644 index 0000000000..ff235c1562 --- /dev/null +++ b/engine/src/flutter/tests/mocha/it-only-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 This suite should only run this test +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mocha/it-only.html b/engine/src/flutter/tests/mocha/it-only.html new file mode 100644 index 0000000000..692eb171be --- /dev/null +++ b/engine/src/flutter/tests/mocha/it-only.html @@ -0,0 +1,18 @@ + + + + + diff --git a/engine/src/flutter/tests/modules/basic-expected.txt b/engine/src/flutter/tests/modules/basic-expected.txt new file mode 100644 index 0000000000..0bc5c8cc16 --- /dev/null +++ b/engine/src/flutter/tests/modules/basic-expected.txt @@ -0,0 +1 @@ +PASS: pass.html succesfully exported this string. diff --git a/engine/src/flutter/tests/modules/basic.html b/engine/src/flutter/tests/modules/basic.html new file mode 100644 index 0000000000..b76fc0dfb5 --- /dev/null +++ b/engine/src/flutter/tests/modules/basic.html @@ -0,0 +1,8 @@ + + + +
FAIL
+ + diff --git a/engine/src/flutter/tests/modules/imports-can-import-expected.txt b/engine/src/flutter/tests/modules/imports-can-import-expected.txt new file mode 100644 index 0000000000..6bb0ab560e --- /dev/null +++ b/engine/src/flutter/tests/modules/imports-can-import-expected.txt @@ -0,0 +1 @@ +{"message":"PASS: pass.html succesfully exported this string."} diff --git a/engine/src/flutter/tests/modules/imports-can-import.html b/engine/src/flutter/tests/modules/imports-can-import.html new file mode 100644 index 0000000000..7983f78e0d --- /dev/null +++ b/engine/src/flutter/tests/modules/imports-can-import.html @@ -0,0 +1,7 @@ + + +
FAIL
+ + diff --git a/engine/src/flutter/tests/modules/resources/intermediate.html b/engine/src/flutter/tests/modules/resources/intermediate.html new file mode 100644 index 0000000000..55420b8f5a --- /dev/null +++ b/engine/src/flutter/tests/modules/resources/intermediate.html @@ -0,0 +1,7 @@ + + + diff --git a/engine/src/flutter/tests/modules/resources/pass.html b/engine/src/flutter/tests/modules/resources/pass.html new file mode 100644 index 0000000000..75631167c9 --- /dev/null +++ b/engine/src/flutter/tests/modules/resources/pass.html @@ -0,0 +1,3 @@ + diff --git a/engine/src/flutter/tests/mutation-observer/callback-arguments-expected.txt b/engine/src/flutter/tests/mutation-observer/callback-arguments-expected.txt new file mode 100644 index 0000000000..b68fab40b7 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/callback-arguments-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver should pass the callback and observer arguments +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/callback-arguments.html b/engine/src/flutter/tests/mutation-observer/callback-arguments.html new file mode 100644 index 0000000000..fefda766d1 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/callback-arguments.html @@ -0,0 +1,18 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery-expected.txt b/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery-expected.txt new file mode 100644 index 0000000000..606493102d --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Transient registrations should be cleared even without delivery +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery.html b/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery.html new file mode 100644 index 0000000000..ebe30d934a --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/clear-transient-without-delivery.html @@ -0,0 +1,28 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/create-during-delivery-expected.txt b/engine/src/flutter/tests/mutation-observer/create-during-delivery-expected.txt new file mode 100644 index 0000000000..8850360a1e --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/create-during-delivery-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObservers must wait for the next loop when created during delivery +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/create-during-delivery.html b/engine/src/flutter/tests/mutation-observer/create-during-delivery.html new file mode 100644 index 0000000000..549ae4e877 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/create-during-delivery.html @@ -0,0 +1,37 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/cross-document-expected.txt b/engine/src/flutter/tests/mutation-observer/cross-document-expected.txt new file mode 100644 index 0000000000..f9addc732a --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/cross-document-expected.txt @@ -0,0 +1,6 @@ +Running 2 tests +ok 1 MutationObserver cross document moves should handle basic observation +ok 2 MutationObserver cross document moves should handle subtree observation +2 tests +2 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/cross-document.html b/engine/src/flutter/tests/mutation-observer/cross-document.html new file mode 100644 index 0000000000..56ec130d2d --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/cross-document.html @@ -0,0 +1,49 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/delivery-order-expected.txt b/engine/src/flutter/tests/mutation-observer/delivery-order-expected.txt new file mode 100644 index 0000000000..53bcfce41f --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/delivery-order-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver should deliver in order of creation +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/delivery-order.html b/engine/src/flutter/tests/mutation-observer/delivery-order.html new file mode 100644 index 0000000000..11be804e0d --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/delivery-order.html @@ -0,0 +1,40 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending-expected.txt b/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending-expected.txt new file mode 100644 index 0000000000..f87992fda2 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver.disconnect should cancel pending delivery +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending.html b/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending.html new file mode 100644 index 0000000000..f35101f48f --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/disconnect-cancel-pending.html @@ -0,0 +1,44 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/document-fragment-insertion-expected.txt b/engine/src/flutter/tests/mutation-observer/document-fragment-insertion-expected.txt new file mode 100644 index 0000000000..dd23333a41 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/document-fragment-insertion-expected.txt @@ -0,0 +1,7 @@ +Running 3 tests +ok 1 DocumentFragments should remove all children of the fragment before moving children, using appendChild +ok 2 DocumentFragments should remove all children of the fragment before moving children, using insertBefore +ok 3 DocumentFragments should remove all children of the fragment before moving children, using replaceChild +3 tests +3 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/document-fragment-insertion.html b/engine/src/flutter/tests/mutation-observer/document-fragment-insertion.html new file mode 100644 index 0000000000..d446c0083b --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/document-fragment-insertion.html @@ -0,0 +1,69 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/mutate-during-delivery-expected.txt b/engine/src/flutter/tests/mutation-observer/mutate-during-delivery-expected.txt new file mode 100644 index 0000000000..2cd9842328 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutate-during-delivery-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver should not interrupt delivery order on getting mutations during delivery +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/mutate-during-delivery.html b/engine/src/flutter/tests/mutation-observer/mutate-during-delivery.html new file mode 100644 index 0000000000..b605daa38a --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutate-during-delivery.html @@ -0,0 +1,34 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash-expected.txt b/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash-expected.txt new file mode 100644 index 0000000000..bc057cbdff --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash-expected.txt @@ -0,0 +1 @@ +PASS. We didn't crash diff --git a/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash.html b/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash.html new file mode 100644 index 0000000000..205921c863 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-callback-non-element-crash.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor-expected.txt b/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor-expected.txt new file mode 100644 index 0000000000..3a84b311af --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor-expected.txt @@ -0,0 +1,6 @@ +Running 2 tests +ok 1 MutationObserver should have methods +ok 2 MutationObserver should throw with incorrect constructor args +2 tests +2 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor.html b/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor.html new file mode 100644 index 0000000000..df07463c87 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-observer-constructor.html @@ -0,0 +1,28 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/mutation-record-constructor-expected.txt b/engine/src/flutter/tests/mutation-observer/mutation-record-constructor-expected.txt new file mode 100644 index 0000000000..5676f7c77c --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-record-constructor-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationRecord should be exposed on window but not constructable +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/mutation-record-constructor.html b/engine/src/flutter/tests/mutation-observer/mutation-record-constructor.html new file mode 100644 index 0000000000..7fd7d7ed8a --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-record-constructor.html @@ -0,0 +1,22 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/mutation-record-nullity-expected.txt b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity-expected.txt new file mode 100644 index 0000000000..a972d009b2 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity-expected.txt @@ -0,0 +1,7 @@ +Running 3 tests +ok 1 Non-relevant properties on mutation records should be null, except for NodeLists, which should be empty on characterData records +ok 2 Non-relevant properties on mutation records should be null, except for NodeLists, which should be empty on childList records +ok 3 Non-relevant properties on mutation records should be null, except for NodeLists, which should be empty on attribute records +3 tests +3 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.html b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.html new file mode 100644 index 0000000000..a32e945954 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.html @@ -0,0 +1,42 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt new file mode 100644 index 0000000000..1afd06f8e3 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt @@ -0,0 +1,19 @@ +Running 15 tests +ok 1 MutationObserver.observe on attributes should handle basic aspects of attribute observation +ok 2 MutationObserver.observe on attributes should not notify of attribute changes without asking +ok 3 MutationObserver.observe on attributes re-observing the same node with the same observer has the effect of resetting the options +ok 4 MutationObserver.observe on attributes multiple observers can be registered to a given node and both receive mutations +ok 5 MutationObserver.observe on attributes should deliver mutations on modifications to node properties which delegate to attribute storage +ok 6 MutationObserver.observe on attributes should handle basic oldValue delivery +ok 7 MutationObserver.observe on attributes should deliver oldValue when needed +ok 8 MutationObserver.observe on attributes should give attributeOldValue if any entries request it with multiple observers +ok 9 MutationObserver.observe on attributes should handle setting an attribute via reflected IDL attribute +ok 10 MutationObserver.observe on attributes should respect attributeFilter on HTML elements +ok 11 MutationObserver.observe on attributes should respect different attributeFilters when observing multiple subtree nodes +ok 12 MutationObserver.observe on attributes should create records for the style property +ok 13 MutationObserver.observe on attributes should have oldValue for style property mutations +ok 14 MutationObserver.observe on attributes should not create records for noop style property mutation +ok 15 MutationObserver.observe on attributes should create records when mutating through the attribute collection +15 tests +15 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-attributes.html b/engine/src/flutter/tests/mutation-observer/observe-attributes.html new file mode 100644 index 0000000000..6261cf6ab7 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-attributes.html @@ -0,0 +1,601 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-characterdata-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-characterdata-expected.txt new file mode 100644 index 0000000000..6edd60abb8 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-characterdata-expected.txt @@ -0,0 +1,10 @@ +Running 6 tests +ok 1 MutationObserver on character data should handle basic aspects of characterData observation +ok 2 MutationObserver on character data should only notify of characterData changes when requested +ok 3 MutationObserver on character data should allow multiple observers can be registered to a given node and both receive mutations +ok 4 MutationObserver on character data should provide oldValue is returned when requested +ok 5 MutationObserver on character data should allow observing both with and without oldValue +ok 6 MutationObserver on character data should provide oldValue if any observation requests it +6 tests +6 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-characterdata.html b/engine/src/flutter/tests/mutation-observer/observe-characterdata.html new file mode 100644 index 0000000000..c686e3b91d --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-characterdata.html @@ -0,0 +1,229 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-childList-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-childList-expected.txt new file mode 100644 index 0000000000..ad35d53d38 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-childList-expected.txt @@ -0,0 +1,11 @@ +Running 7 tests +ok 1 MutationObserver.observe on childList should handle basic observation +ok 2 MutationObserver.observe on childList should handle observing without specifying "childList" does not result in hearing about childList changes +ok 3 MutationObserver.observe on childList should handle re-observing the same node with the same observer has the effect of resetting the options +ok 4 MutationObserver.observe on childList should handle multiple observers can be registered to a given node and both receive mutations +ok 5 MutationObserver.observe on childList should create minimal mutations for replaceChild +ok 6 MutationObserver.observe on childList should create minimal mutations for insertBefore +ok 7 MutationObserver.observe on childList should create minimal mutations for appendChild +7 tests +7 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-childList.html b/engine/src/flutter/tests/mutation-observer/observe-childList.html new file mode 100644 index 0000000000..feaa1d3142 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-childList.html @@ -0,0 +1,322 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-exceptions-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-exceptions-expected.txt new file mode 100644 index 0000000000..e7ecccc69b --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-exceptions-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver observe should throw on invalid input +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-exceptions.html b/engine/src/flutter/tests/mutation-observer/observe-exceptions.html new file mode 100644 index 0000000000..67aef9f5be --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-exceptions.html @@ -0,0 +1,54 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-options-attributes-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-options-attributes-expected.txt new file mode 100644 index 0000000000..1f3904a61e --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-options-attributes-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver.observe should observe attributes +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-options-attributes.html b/engine/src/flutter/tests/mutation-observer/observe-options-attributes.html new file mode 100644 index 0000000000..d3b884ab68 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-options-attributes.html @@ -0,0 +1,34 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-options-character-data-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-options-character-data-expected.txt new file mode 100644 index 0000000000..aedc61cc53 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-options-character-data-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Test MutationObserver.observe should respect character data options +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-options-character-data.html b/engine/src/flutter/tests/mutation-observer/observe-options-character-data.html new file mode 100644 index 0000000000..610e584fc7 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-options-character-data.html @@ -0,0 +1,26 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observe-subtree-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-subtree-expected.txt new file mode 100644 index 0000000000..9ae9a7faa6 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-subtree-expected.txt @@ -0,0 +1,9 @@ +Running 5 tests +ok 1 MutationObserver.observe on a subtree should handle basic aspects of subtree observation +ok 2 MutationObserver.observe on a subtree should handle two observers at different depths +ok 3 MutationObserver.observe on a subtree should handle one observer at two different depths +ok 4 MutationObserver.observe on a subtree should handle transiently detached nodes are still observed via subtree +ok 5 MutationObserver.observe on a subtree should have correct behavior of transient observation with complex movement +5 tests +5 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-subtree.html b/engine/src/flutter/tests/mutation-observer/observe-subtree.html new file mode 100644 index 0000000000..bd79947925 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observe-subtree.html @@ -0,0 +1,264 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff-transient.html b/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff-transient.html new file mode 100644 index 0000000000..91c5002c1a --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff-transient.html @@ -0,0 +1,29 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff.html b/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff.html new file mode 100644 index 0000000000..b7f76ba1fa --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/observer-wrapper-dropoff.html @@ -0,0 +1,28 @@ + + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/script-append-expected.txt b/engine/src/flutter/tests/mutation-observer/script-append-expected.txt new file mode 100644 index 0000000000..3e59fd9040 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/script-append-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver should not invoke callbacks when appending a script +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/script-append.html b/engine/src/flutter/tests/mutation-observer/script-append.html new file mode 100644 index 0000000000..aa96597324 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/script-append.html @@ -0,0 +1,27 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/shadow-dom-expected.txt b/engine/src/flutter/tests/mutation-observer/shadow-dom-expected.txt new file mode 100644 index 0000000000..2c9b2cde2b --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/shadow-dom-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObservers should handle shadow dom +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/shadow-dom.html b/engine/src/flutter/tests/mutation-observer/shadow-dom.html new file mode 100644 index 0000000000..e4f4751872 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/shadow-dom.html @@ -0,0 +1,40 @@ + + + +
+ + diff --git a/engine/src/flutter/tests/mutation-observer/takeRecords-expected.txt b/engine/src/flutter/tests/mutation-observer/takeRecords-expected.txt new file mode 100644 index 0000000000..3dcb0acd9b --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/takeRecords-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 MutationObserver.takeRecords should allow taking records synchronously or getting a notification +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/mutation-observer/takeRecords.html b/engine/src/flutter/tests/mutation-observer/takeRecords.html new file mode 100644 index 0000000000..cbceb205f7 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/takeRecords.html @@ -0,0 +1,53 @@ + + + + + diff --git a/engine/src/flutter/tests/mutation-observer/transient-gc-crash.html b/engine/src/flutter/tests/mutation-observer/transient-gc-crash.html new file mode 100644 index 0000000000..e6d4bb6af4 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/transient-gc-crash.html @@ -0,0 +1,22 @@ + + diff --git a/engine/src/flutter/tests/mutation-observer/weak-callback-gc-crash.html b/engine/src/flutter/tests/mutation-observer/weak-callback-gc-crash.html new file mode 100644 index 0000000000..4cb6819f14 --- /dev/null +++ b/engine/src/flutter/tests/mutation-observer/weak-callback-gc-crash.html @@ -0,0 +1,17 @@ + +
Test passes if it does not crash
+ + diff --git a/engine/src/flutter/tests/services/buffer-expected.txt b/engine/src/flutter/tests/services/buffer-expected.txt new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/engine/src/flutter/tests/services/buffer-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/engine/src/flutter/tests/services/buffer.html b/engine/src/flutter/tests/services/buffer.html new file mode 100644 index 0000000000..6a622b674b --- /dev/null +++ b/engine/src/flutter/tests/services/buffer.html @@ -0,0 +1,9 @@ + + + +
FAIL
+ + diff --git a/engine/src/flutter/tests/services/codec-expected.txt b/engine/src/flutter/tests/services/codec-expected.txt new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/engine/src/flutter/tests/services/codec-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/engine/src/flutter/tests/services/codec.html b/engine/src/flutter/tests/services/codec.html new file mode 100644 index 0000000000..cde4a6997d --- /dev/null +++ b/engine/src/flutter/tests/services/codec.html @@ -0,0 +1,9 @@ + + + +
FAIL
+ + diff --git a/engine/src/flutter/tests/services/core-expected.txt b/engine/src/flutter/tests/services/core-expected.txt new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/engine/src/flutter/tests/services/core-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/engine/src/flutter/tests/services/core.html b/engine/src/flutter/tests/services/core.html new file mode 100644 index 0000000000..7911fa69f7 --- /dev/null +++ b/engine/src/flutter/tests/services/core.html @@ -0,0 +1,9 @@ + + + +
FAIL
+ + diff --git a/engine/src/flutter/tests/services/network-expected.txt b/engine/src/flutter/tests/services/network-expected.txt new file mode 100644 index 0000000000..8cc3706a66 --- /dev/null +++ b/engine/src/flutter/tests/services/network-expected.txt @@ -0,0 +1,9 @@ +CONSOLE: LOG: url => http://127.0.0.1:8000/services/resources/pass.txt +CONSOLE: LOG: status_line => HTTP/1.1 200 OK +CONSOLE: LOG: mime_type => text/plain +CONSOLE: LOG: read 31 bytes +Running 1 tests +ok 1 Mojo network_service should be able to fetch text files +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/services/network.html b/engine/src/flutter/tests/services/network.html new file mode 100644 index 0000000000..43eaa17742 --- /dev/null +++ b/engine/src/flutter/tests/services/network.html @@ -0,0 +1,49 @@ + + + + + + + + + diff --git a/engine/src/flutter/tests/services/resources/pass.txt b/engine/src/flutter/tests/services/resources/pass.txt new file mode 100644 index 0000000000..5cd2c5ee07 --- /dev/null +++ b/engine/src/flutter/tests/services/resources/pass.txt @@ -0,0 +1 @@ +This is data from the network. diff --git a/engine/src/flutter/tests/styles/inline-style-expected.txt b/engine/src/flutter/tests/styles/inline-style-expected.txt new file mode 100644 index 0000000000..6954db14af --- /dev/null +++ b/engine/src/flutter/tests/styles/inline-style-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Inline styles should be settable using "style" attribute +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/styles/inline-style.html b/engine/src/flutter/tests/styles/inline-style.html new file mode 100644 index 0000000000..7265530bef --- /dev/null +++ b/engine/src/flutter/tests/styles/inline-style.html @@ -0,0 +1,20 @@ + + + + + + diff --git a/engine/src/flutter/tools/debugger/BUILD.gn b/engine/src/flutter/tools/debugger/BUILD.gn new file mode 100644 index 0000000000..59de1cca1c --- /dev/null +++ b/engine/src/flutter/tools/debugger/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +group("debugger") { + testonly = true + + deps = [ + "//sky/tools/debugger/prompt", + ":sky_debugger", + ] +} + +shared_library("sky_debugger") { + output_name = "mojo_sky_debugger" + + sources = [ + "debugger.cc", + "focus_rules.cc", + "focus_rules.h", + ] + + deps = [ + "//base", + "//mojo/application", + "//mojo/converters/geometry", + "//mojo/converters/input_events", + "//mojo/public/c/system:for_shared_library", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/utility", + "//mojo/services/public/cpp/view_manager", + "//mojo/services/window_manager:lib", + "//sky/viewer:bindings", + ":bindings", + ] +} + +mojom("bindings") { + sources = [ + "debugger.mojom", + ] +} diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc new file mode 100644 index 0000000000..8b0e0d14cf --- /dev/null +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -0,0 +1,116 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mojo/application/application_runner_chromium.h" +#include "mojo/public/c/system/main.h" +#include "mojo/public/cpp/application/application_delegate.h" +#include "mojo/public/cpp/application/application_impl.h" +#include "mojo/public/cpp/application/connect.h" +#include "mojo/public/cpp/application/service_provider_impl.h" +#include "mojo/services/public/cpp/view_manager/view_manager.h" +#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" +#include "mojo/services/public/cpp/view_manager/view_observer.h" +#include "mojo/services/public/interfaces/input_events/input_events.mojom.h" +#include "mojo/services/window_manager/window_manager_app.h" +#include "mojo/services/window_manager/window_manager_delegate.h" +#include "sky/tools/debugger/focus_rules.h" +#include "sky/tools/debugger/debugger.mojom.h" + +namespace sky { + +class SkyDebugger : public mojo::ApplicationDelegate, + public mojo::ViewManagerDelegate, + public mojo::ViewObserver, + public mojo::InterfaceFactory, + public mojo::InterfaceImpl { + public: + SkyDebugger() + : window_manager_app_(new mojo::WindowManagerApp(this, nullptr)), + view_manager_(nullptr), + root_(nullptr), + content_(nullptr) {} + virtual ~SkyDebugger() {} + + private: + // Overridden from mojo::ApplicationDelegate: + virtual void Initialize(mojo::ApplicationImpl* app) override { + window_manager_app_->Initialize(app); + app->ConnectToApplication("mojo:sky_debugger_prompt"); + } + + virtual bool ConfigureIncomingConnection( + mojo::ApplicationConnection* connection) override { + window_manager_app_->ConfigureIncomingConnection(connection); + connection->AddService(this); + return true; + } + + virtual bool ConfigureOutgoingConnection( + mojo::ApplicationConnection* connection) override { + window_manager_app_->ConfigureOutgoingConnection(connection); + connection->AddService(this); + return true; + } + + // Overridden from mojo::ViewManagerDelegate: + virtual void OnEmbed( + mojo::ViewManager* view_manager, + mojo::View* root, + mojo::ServiceProviderImpl* exported_services, + scoped_ptr remote_service_provider) override { + view_manager_ = view_manager; + + root_ = root; + root_->AddObserver(this); + + content_ = mojo::View::Create(view_manager_); + content_->SetBounds(root_->bounds()); + root_->AddChild(content_); + + window_manager_app_->InitFocus( + new FocusRules(window_manager_app_.get(), content_)); + } + + virtual void OnViewManagerDisconnected( + mojo::ViewManager* view_manager) override { + view_manager_ = nullptr; + root_ = nullptr; + } + + virtual void OnViewDestroyed(mojo::View* view) override { + view->RemoveObserver(this); + } + + virtual void OnViewBoundsChanged(mojo::View* view, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override { + content_->SetBounds(new_bounds); + } + + // Overridden from InterfaceFactory + virtual void Create(mojo::ApplicationConnection* connection, + mojo::InterfaceRequest request) override { + mojo::WeakBindToRequest(this, &request); + } + + // Overridden from Debugger + virtual void NavigateToURL(const mojo::String& url) override { + content_->Embed(url); + } + + scoped_ptr window_manager_app_; + + mojo::ViewManager* view_manager_; + mojo::View* root_; + mojo::View* content_; + + DISALLOW_COPY_AND_ASSIGN(SkyDebugger); +}; + +} // namespace sky + +MojoResult MojoMain(MojoHandle shell_handle) { + mojo::ApplicationRunnerChromium runner(new sky::SkyDebugger); + return runner.Run(shell_handle); +} diff --git a/engine/src/flutter/tools/debugger/debugger.mojom b/engine/src/flutter/tools/debugger/debugger.mojom new file mode 100644 index 0000000000..067a160569 --- /dev/null +++ b/engine/src/flutter/tools/debugger/debugger.mojom @@ -0,0 +1,11 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module sky { + +interface Debugger { + NavigateToURL(string url); +}; + +} diff --git a/engine/src/flutter/tools/debugger/focus_rules.cc b/engine/src/flutter/tools/debugger/focus_rules.cc new file mode 100644 index 0000000000..fb193d8b4f --- /dev/null +++ b/engine/src/flutter/tools/debugger/focus_rules.cc @@ -0,0 +1,59 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sky/tools/debugger/focus_rules.h" + +namespace sky { + +FocusRules::FocusRules(mojo::WindowManagerApp* window_manager_app, + mojo::View* content) + : content_(content), + window_manager_app_(window_manager_app) { +} + +FocusRules::~FocusRules() { +} + +bool FocusRules::IsToplevelWindow(aura::Window* window) const { + return mojo::WindowManagerApp::GetViewForWindow(window)->parent() == content_; +} + +bool FocusRules::CanActivateWindow(aura::Window* window) const { + return mojo::WindowManagerApp::GetViewForWindow(window)->parent() == content_; +} + +bool FocusRules::CanFocusWindow(aura::Window* window) const { + return true; +} + +aura::Window* FocusRules::GetToplevelWindow(aura::Window* window) const { + mojo::View* view = mojo::WindowManagerApp::GetViewForWindow(window); + while (view->parent() != content_) { + view = view->parent(); + if (!view) + return NULL; + } + return window_manager_app_->GetWindowForViewId(view->id()); +} + +aura::Window* FocusRules::GetActivatableWindow(aura::Window* window) const { + return GetToplevelWindow(window); +} + +aura::Window* FocusRules::GetFocusableWindow(aura::Window* window) const { + return window; +} + +aura::Window* FocusRules::GetNextActivatableWindow(aura::Window* ignore) const { + aura::Window* activatable = GetActivatableWindow(ignore); + const aura::Window::Windows& children = activatable->parent()->children(); + for (aura::Window::Windows::const_reverse_iterator it = children.rbegin(); + it != children.rend(); ++it) { + if (*it != ignore) + return *it; + } + return NULL; +} + +} // namespace sky diff --git a/engine/src/flutter/tools/debugger/focus_rules.h b/engine/src/flutter/tools/debugger/focus_rules.h new file mode 100644 index 0000000000..ee13cafed8 --- /dev/null +++ b/engine/src/flutter/tools/debugger/focus_rules.h @@ -0,0 +1,37 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SKY_TOOLS_DEBUGGER_FOCUS_RULES_H_ +#define SKY_TOOLS_DEBUGGER_FOCUS_RULES_H_ + +#include "mojo/services/window_manager/window_manager_app.h" +#include "ui/aura/window.h" +#include "ui/wm/core/focus_rules.h" + +namespace sky { + +class FocusRules : public wm::FocusRules { + public: + FocusRules(mojo::WindowManagerApp* window_manager_app, mojo::View* content); + virtual ~FocusRules(); + + private: + // Overridden from wm::FocusRules: + bool IsToplevelWindow(aura::Window* window) const override; + bool CanActivateWindow(aura::Window* window) const override; + bool CanFocusWindow(aura::Window* window) const override; + aura::Window* GetToplevelWindow(aura::Window* window) const override; + aura::Window* GetActivatableWindow(aura::Window* window) const override; + aura::Window* GetFocusableWindow(aura::Window* window) const override; + aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override; + + mojo::View* content_; + mojo::WindowManagerApp* window_manager_app_; + + DISALLOW_COPY_AND_ASSIGN(FocusRules); +}; + +} // namespace sky + +#endif // SKY_TOOLS_DEBUGGER_FOCUS_RULES_H_ diff --git a/engine/src/flutter/tools/debugger/prompt/BUILD.gn b/engine/src/flutter/tools/debugger/prompt/BUILD.gn new file mode 100644 index 0000000000..76412c8077 --- /dev/null +++ b/engine/src/flutter/tools/debugger/prompt/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +shared_library("prompt") { + output_name = "mojo_sky_debugger_prompt" + + sources = [ + "prompt.cc", + ] + + deps = [ + "//base", + "//mojo/application", + "//mojo/public/c/system:for_shared_library", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/utility", + "//sky/tools/debugger:bindings", + "//sky/viewer:bindings", + ] +} diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc new file mode 100644 index 0000000000..60d6733802 --- /dev/null +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -0,0 +1,147 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/bind.h" +#include "base/memory/weak_ptr.h" +#include "mojo/application/application_runner_chromium.h" +#include "mojo/public/c/system/main.h" +#include "mojo/public/cpp/application/application_delegate.h" +#include "mojo/public/cpp/application/application_impl.h" +#include "sky/tools/debugger/debugger.mojom.h" +#include "sky/viewer/services/tracing.mojom.h" +#include + +namespace sky { +namespace debugger { +namespace { + +std::string GetCommand() { + std::cout << "(skydb) "; + std::cout.flush(); + + std::string command; + std::getline(std::cin, command); + // Any errors (including eof) just quit the debugger: + if (!std::cin.good()) + command = 'q'; + return command; +} + +} + +class Prompt : public mojo::ApplicationDelegate { + public: + Prompt() + : is_tracing_(false), + weak_ptr_factory_(this) { + } + virtual ~Prompt() { + } + + private: + // Overridden from mojo::ApplicationDelegate: + virtual void Initialize(mojo::ApplicationImpl* app) override { + app->ConnectToService("mojo:sky_viewer", &tracing_); + ScheduleWaitForInput(); + } + + virtual bool ConfigureIncomingConnection( + mojo::ApplicationConnection* connection) override { + connection->ConnectToService(&debugger_); + return true; + } + + bool ExecuteCommand(const std::string& command) { + if (command == "help") { + PrintHelp(); + return true; + } + if (command == "trace") { + ToggleTracing(); + return true; + } + if (command == "reload") { + Reload(); + return true; + } + if (command.size() == 1) { + char c = command[0]; + if (c == 'h') + PrintHelp(); + else if (c == 'q') + Quit(); + else if (c == 'r') + Reload(); + else + std::cout << "Unknown command: " << c << std::endl; + return true; + } + return false; + } + + void WaitForInput() { + std::string command = GetCommand(); + + if (!ExecuteCommand(command)) { + if (command.size() > 0) { + url_ = command; + Reload(); + } + } + + ScheduleWaitForInput(); + } + + void ScheduleWaitForInput() { + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&Prompt::WaitForInput, weak_ptr_factory_.GetWeakPtr())); + } + + void PrintHelp() { + std::cout + << "Sky Debugger" << std::endl + << "============" << std::endl + << "Type a URL to load in the debugger, enter to reload." << std::endl + << "Commands: help -- Help" << std::endl + << " trace -- Capture a trace" << std::endl + << " reload -- Reload the current page" << std::endl + << " q -- Quit" << std::endl; + } + + void Reload() { + debugger_->NavigateToURL(url_); + } + + void Quit() { + std::cout << "quitting" << std::endl; + exit(0); + } + + void ToggleTracing() { + if (is_tracing_) { + std::cout << "Stopping trace (writing to sky_viewer.trace)" << std::endl; + tracing_->Stop(); + } else { + std::cout << "Starting trace (type 'trace' to stop tracing)" << std::endl; + tracing_->Start(); + } + is_tracing_ = !is_tracing_; + } + + bool is_tracing_; + DebuggerPtr debugger_; + TracingPtr tracing_; + std::string url_; + base::WeakPtrFactory weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(Prompt); +}; + +} // namespace debugger +} // namespace sky + +MojoResult MojoMain(MojoHandle shell_handle) { + mojo::ApplicationRunnerChromium runner(new sky::debugger::Prompt); + return runner.Run(shell_handle); +} diff --git a/engine/src/flutter/tools/lint_test_expectations b/engine/src/flutter/tools/lint_test_expectations new file mode 100755 index 0000000000..c56eb77dbb --- /dev/null +++ b/engine/src/flutter/tools/lint_test_expectations @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright (C) 2012 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import sys + +from webkitpy.common import version_check +from webkitpy.layout_tests import lint_test_expectations + + +sys.exit(lint_test_expectations.main(sys.argv[1:], sys.stdout, sys.stderr)) + diff --git a/engine/src/flutter/tools/lint_webkitpy b/engine/src/flutter/tools/lint_webkitpy new file mode 100755 index 0000000000..4e6af9fae9 --- /dev/null +++ b/engine/src/flutter/tools/lint_webkitpy @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import sys + +from webkitpy.style.checkers.python import PythonChecker + +for path in sys.argv[1:]: + checker = PythonChecker(path, lambda *args: None) + sys.stdout.write(checker._run_pylint(path)) diff --git a/engine/src/flutter/tools/read_checksum_from_png b/engine/src/flutter/tools/read_checksum_from_png new file mode 100755 index 0000000000..fb03f28b7e --- /dev/null +++ b/engine/src/flutter/tools/read_checksum_from_png @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from __future__ import with_statement +import sys + +from webkitpy.common import read_checksum_from_png + + +if '__main__' == __name__: + for filename in sys.argv[1:]: + with open(filename, 'r') as filehandle: + print "%s: %s" % (read_checksum_from_png.read_checksum(filehandle), filename) diff --git a/engine/src/flutter/tools/run_sky_httpd b/engine/src/flutter/tools/run_sky_httpd new file mode 100755 index 0000000000..a3a01a4d54 --- /dev/null +++ b/engine/src/flutter/tools/run_sky_httpd @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# Copyright (C) 2010 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import webkitpy.common.version_check + +from webkitpy.layout_tests.servers import cli_wrapper +from webkitpy.layout_tests.servers import apache_http + +cli_wrapper.main(apache_http.ApacheHTTP, additional_dirs={}, number_of_servers=4) diff --git a/engine/src/flutter/tools/run_sky_websocketserver b/engine/src/flutter/tools/run_sky_websocketserver new file mode 100755 index 0000000000..4053e8b89d --- /dev/null +++ b/engine/src/flutter/tools/run_sky_websocketserver @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# Copyright (C) 2012 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import webkitpy.common.version_check + +from webkitpy.layout_tests.servers import cli_wrapper +from webkitpy.layout_tests.servers import pywebsocket + +cli_wrapper.main(pywebsocket.PyWebSocket) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb new file mode 100755 index 0000000000..5c3af21c83 --- /dev/null +++ b/engine/src/flutter/tools/skydb @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import subprocess + +build_directory = 'out' +config_directory = 'Debug' + +mojo_shell = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, + os.pardir, build_directory, config_directory, 'mojo_shell')) + +subprocess.call([ + mojo_shell, + '--content-handlers=text/html,mojo://sky_viewer/', + '--url-mappings=mojo:window_manager=mojo:sky_debugger', + 'mojo:window_manager', +]) diff --git a/engine/src/flutter/tools/test_bindings b/engine/src/flutter/tools/test_bindings new file mode 100755 index 0000000000..1cba1c0c1a --- /dev/null +++ b/engine/src/flutter/tools/test_bindings @@ -0,0 +1,50 @@ +#!/usr/bin/python +# Copyright (C) 2010 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +import sys + +from webkitpy.bindings.main import run_bindings_tests + +def main(argv): + """Runs Blink bindings IDL compiler on test IDL files and compares the + results with reference files. + + Please execute the script whenever changes are made to the compiler + (this is automatically done as a presubmit script), + and submit changes to the test results in the same patch. + This makes it easier to track and review changes in generated code. + + Options: + --reset-results: Overwrites reference files with the generated results. + --verbose: Show output on success and logging messages (not just failure) + """ + reset_results = '--reset-results' in argv + verbose = '--verbose' in argv + + return run_bindings_tests(reset_results, verbose) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/engine/src/flutter/tools/test_perf b/engine/src/flutter/tools/test_perf new file mode 100755 index 0000000000..1bf8ec8627 --- /dev/null +++ b/engine/src/flutter/tools/test_perf @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# Copyright (C) 2012 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Run performance tests.""" + +import logging +import sys + +from webkitpy.performance_tests.perftestsrunner import PerfTestsRunner + +if '__main__' == __name__: + logging.basicConfig(level=logging.INFO, format="%(message)s") + + sys.exit(PerfTestsRunner().run()) diff --git a/engine/src/flutter/tools/test_sky b/engine/src/flutter/tools/test_sky new file mode 100755 index 0000000000..4d6826e8f0 --- /dev/null +++ b/engine/src/flutter/tools/test_sky @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# Copyright (C) 2012 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py""" +from webkitpy.common import multiprocessing_bootstrap + +multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py') diff --git a/engine/src/flutter/tools/test_webkitpy b/engine/src/flutter/tools/test_webkitpy new file mode 100755 index 0000000000..ee682cccf0 --- /dev/null +++ b/engine/src/flutter/tools/test_webkitpy @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Google Inc. All rights reserved. +# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +from webkitpy.common import multiprocessing_bootstrap + +multiprocessing_bootstrap.run('webkitpy', 'test', 'main.py') diff --git a/engine/src/flutter/tools/tester/BUILD.gn b/engine/src/flutter/tools/tester/BUILD.gn new file mode 100644 index 0000000000..93e0985f09 --- /dev/null +++ b/engine/src/flutter/tools/tester/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +shared_library("tester") { + output_name = "mojo_sky_tester" + + sources = [ + "test_harness.cc", + "test_harness.h", + "test_observer_impl.cc", + "test_observer_impl.h", + "test_runner.cc", + "test_runner.h", + "tester.cc", + ] + + deps = [ + "//base", + "//mojo/application", + "//mojo/converters/geometry", + "//mojo/converters/input_events", + "//mojo/public/c/system:for_shared_library", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/utility", + "//mojo/services/public/cpp/view_manager", + "//mojo/services/window_manager:lib", + "//sky/viewer:bindings", + ] +} diff --git a/engine/src/flutter/tools/tester/test_harness.cc b/engine/src/flutter/tools/tester/test_harness.cc new file mode 100644 index 0000000000..82d4fb9f16 --- /dev/null +++ b/engine/src/flutter/tools/tester/test_harness.cc @@ -0,0 +1,49 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sky/tools/tester/test_harness.h" + +#include "base/bind.h" +#include "base/message_loop/message_loop.h" +#include + +namespace sky { +namespace tester { +namespace { + +std::string WaitForURL() { + std::string url; + std::cin >> url; + return url; +} + +} // namespace + +TestHarness::TestHarness(mojo::View* container) + : container_(container), + weak_ptr_factory_(this) { + std::cout << "#READY\n"; + std::cout.flush(); +} + +TestHarness::~TestHarness() { +} + +void TestHarness::ScheduleRun() { + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&TestHarness::Run, weak_ptr_factory_.GetWeakPtr())); +} + +void TestHarness::Run() { + DCHECK(!test_runner_); + test_runner_.reset(new TestRunner(this, container_, WaitForURL())); +} + +void TestHarness::OnTestComplete() { + test_runner_.reset(); + ScheduleRun(); +} + +} // namespace tester +} // namespace sky diff --git a/engine/src/flutter/tools/tester/test_harness.h b/engine/src/flutter/tools/tester/test_harness.h new file mode 100644 index 0000000000..4c52bf0ce7 --- /dev/null +++ b/engine/src/flutter/tools/tester/test_harness.h @@ -0,0 +1,39 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SKY_TOOLS_TESTER_TEST_HARNESS_H_ +#define SKY_TOOLS_TESTER_TEST_HARNESS_H_ + +#include "base/memory/weak_ptr.h" +#include "sky/tools/tester/test_runner.h" + +namespace mojo{ +class View; +} + +namespace sky { +namespace tester { + +class TestHarness : public TestRunnerClient { + public: + explicit TestHarness(mojo::View* container); + virtual ~TestHarness(); + + void ScheduleRun(); + + private: + void Run(); + void OnTestComplete() override; + + mojo::View* container_; + scoped_ptr test_runner_; + base::WeakPtrFactory weak_ptr_factory_; + + MOJO_DISALLOW_COPY_AND_ASSIGN(TestHarness); +}; + +} // namespace tester +} // namespace sky + +#endif // SKY_TOOLS_TESTER_TEST_HARNESS_H_ diff --git a/engine/src/flutter/tools/tester/test_observer_impl.cc b/engine/src/flutter/tools/tester/test_observer_impl.cc new file mode 100644 index 0000000000..0037d507e7 --- /dev/null +++ b/engine/src/flutter/tools/tester/test_observer_impl.cc @@ -0,0 +1,29 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sky/tools/tester/test_observer_impl.h" + +#include "sky/tools/tester/test_runner.h" + +namespace sky { +namespace tester { + +TestObserverImpl::TestObserverImpl(TestRunner* test_runner) + : test_runner_(test_runner->GetWeakPtr()) { + // FIXME: This is technically when the V8 context gets created and + // not when the test is started. An error before we instantiated + // the V8 context would show up before the #BEGIN line for this test. + test_runner->OnTestStart(); +} + +TestObserverImpl::~TestObserverImpl() { +} + +void TestObserverImpl::OnTestComplete(const mojo::String& test_result) { + if (test_runner_) + test_runner_->OnTestComplete(test_result); +} + +} // namespace tester +} // namespace sky diff --git a/engine/src/flutter/tools/tester/test_observer_impl.h b/engine/src/flutter/tools/tester/test_observer_impl.h new file mode 100644 index 0000000000..1543016a74 --- /dev/null +++ b/engine/src/flutter/tools/tester/test_observer_impl.h @@ -0,0 +1,37 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SKY_TOOLS_TESTER_TEST_OBSERVER_IMPL_H_ +#define SKY_TOOLS_TESTER_TEST_OBSERVER_IMPL_H_ + +#include "base/memory/weak_ptr.h" +#include "mojo/public/cpp/application/interface_factory_impl.h" +#include "mojo/public/cpp/system/core.h" +#include "sky/viewer/test_observer.mojom.h" + +namespace sky { +namespace tester { +class TestRunner; + +class TestObserverImpl : public mojo::InterfaceImpl { + public: + explicit TestObserverImpl(TestRunner*); + virtual ~TestObserverImpl(); + + private: + // TestObserver implementation. + virtual void OnTestComplete(const mojo::String& test_result) override; + + base::WeakPtr test_runner_; + + MOJO_DISALLOW_COPY_AND_ASSIGN(TestObserverImpl); +}; + +typedef mojo::InterfaceFactoryImplWithContext< + TestObserverImpl, TestRunner> TestObserverFactory; + +} // namespace tester +} // namespace sky + +#endif // SKY_TOOLS_TESTER_TEST_OBSERVER_IMPL_H_ diff --git a/engine/src/flutter/tools/tester/test_runner.cc b/engine/src/flutter/tools/tester/test_runner.cc new file mode 100644 index 0000000000..282531bb7b --- /dev/null +++ b/engine/src/flutter/tools/tester/test_runner.cc @@ -0,0 +1,55 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sky/tools/tester/test_runner.h" + +#include +#include "base/bind.h" +#include "mojo/public/cpp/application/connect.h" +#include "mojo/public/cpp/application/service_provider_impl.h" +#include "mojo/services/public/cpp/view_manager/view.h" + +namespace sky { +namespace tester { + +TestRunner::TestRunner(TestRunnerClient* client, mojo::View* container, + const std::string& url) + : test_observer_factory_(this), + client_(client), + weak_ptr_factory_(this) { + CHECK(client); + + scoped_ptr exported_services( + new mojo::ServiceProviderImpl()); + exported_services->AddService(&test_observer_factory_); + + container->Embed(url, exported_services.Pass()); +} + +TestRunner::~TestRunner() { +} + +base::WeakPtr TestRunner::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} + +void TestRunner::OnTestStart() { + std::cout << "#BEGIN\n"; + std::cout.flush(); +} + +void TestRunner::OnTestComplete(const std::string& test_result) { + std::cout << "Content-Type: text/plain\n"; + std::cout << test_result << "\n"; + std::cout << "#EOF\n"; + std::cout << "#EOF\n"; + std::cout.flush(); + std::cerr << "#EOF\n"; + std::cerr.flush(); + + client_->OnTestComplete(); +} + +} // namespace tester +} // namespace sky diff --git a/engine/src/flutter/tools/tester/test_runner.h b/engine/src/flutter/tools/tester/test_runner.h new file mode 100644 index 0000000000..0a1173a445 --- /dev/null +++ b/engine/src/flutter/tools/tester/test_runner.h @@ -0,0 +1,44 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SKY_TOOLS_TESTER_TEST_RUNNER_H_ +#define SKY_TOOLS_TESTER_TEST_RUNNER_H_ + +#include "base/memory/weak_ptr.h" +#include "sky/tools/tester/test_observer_impl.h" + +namespace mojo{ +class View; +} + +namespace sky { +namespace tester { + +class TestRunnerClient { + public: + virtual void OnTestComplete() = 0; +}; + +class TestRunner { + public: + TestRunner(TestRunnerClient* client, mojo::View* container, + const std::string& url); + virtual ~TestRunner(); + + base::WeakPtr GetWeakPtr(); + void OnTestStart(); + void OnTestComplete(const std::string& test_result); + + private: + TestObserverFactory test_observer_factory_; + TestRunnerClient* client_; + base::WeakPtrFactory weak_ptr_factory_; + + MOJO_DISALLOW_COPY_AND_ASSIGN(TestRunner); +}; + +} // namespace tester +} // namespace sky + +#endif // SKY_TOOLS_TESTER_TEST_RUNNER_H_ diff --git a/engine/src/flutter/tools/tester/tester.cc b/engine/src/flutter/tools/tester/tester.cc new file mode 100644 index 0000000000..051236a786 --- /dev/null +++ b/engine/src/flutter/tools/tester/tester.cc @@ -0,0 +1,101 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mojo/application/application_runner_chromium.h" +#include "mojo/public/c/system/main.h" +#include "mojo/public/cpp/application/application_delegate.h" +#include "mojo/public/cpp/application/application_impl.h" +#include "mojo/public/cpp/application/connect.h" +#include "mojo/public/cpp/application/service_provider_impl.h" +#include "mojo/services/public/cpp/view_manager/view_manager.h" +#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" +#include "mojo/services/public/cpp/view_manager/view_observer.h" +#include "mojo/services/public/interfaces/input_events/input_events.mojom.h" +#include "mojo/services/window_manager/window_manager_app.h" +#include "mojo/services/window_manager/window_manager_delegate.h" +#include "sky/tools/tester/test_harness.h" + +namespace sky { +namespace tester { + +class SkyTester : public mojo::ApplicationDelegate, + public mojo::ViewManagerDelegate, + public mojo::WindowManagerDelegate, + public mojo::ViewObserver { + public: + SkyTester() + : window_manager_app_(new mojo::WindowManagerApp(this, this)), + view_manager_(NULL), + root_(NULL), + content_(NULL) {} + virtual ~SkyTester() {} + + private: + // Overridden from mojo::ApplicationDelegate: + virtual void Initialize(mojo::ApplicationImpl* impl) override { + window_manager_app_->Initialize(impl); + } + virtual bool ConfigureIncomingConnection( + mojo::ApplicationConnection* connection) override { + window_manager_app_->ConfigureIncomingConnection(connection); + return true; + } + + // Overridden from mojo::ViewManagerDelegate: + virtual void OnEmbed( + mojo::ViewManager* view_manager, + mojo::View* root, + mojo::ServiceProviderImpl* exported_services, + scoped_ptr remote_service_provider) override { + view_manager_ = view_manager; + root_ = root; + root_->AddObserver(this); + + content_ = mojo::View::Create(view_manager_); + content_->SetBounds(root_->bounds()); + root_->AddChild(content_); + + test_harness_.reset(new TestHarness(content_)); + test_harness_->ScheduleRun(); + } + + // Overridden from WindowManagerDelegate: + virtual void Embed( + const mojo::String& url, + mojo::InterfaceRequest service_provider) override { + } + + virtual void OnViewManagerDisconnected( + mojo::ViewManager* view_manager) override { + view_manager_ = NULL; + root_ = NULL; + } + + virtual void OnViewDestroyed(mojo::View* view) override { + view->RemoveObserver(this); + } + + virtual void OnViewBoundsChanged(mojo::View* view, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override { + content_->SetBounds(new_bounds); + } + + scoped_ptr window_manager_app_; + + mojo::ViewManager* view_manager_; + mojo::View* root_; + mojo::View* content_; + scoped_ptr test_harness_; + + DISALLOW_COPY_AND_ASSIGN(SkyTester); +}; + +} // namespace tester +} // namespace examples + +MojoResult MojoMain(MojoHandle shell_handle) { + mojo::ApplicationRunnerChromium runner(new sky::tester::SkyTester); + return runner.Run(shell_handle); +} diff --git a/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch.rb b/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch.rb new file mode 100644 index 0000000000..f5d80babb7 --- /dev/null +++ b/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch.rb @@ -0,0 +1,1005 @@ +require 'cgi' +require 'diff' +require 'open3' +require 'open-uri' +require 'pp' +require 'set' +require 'tempfile' + +module PrettyPatch + +public + + GIT_PATH = "git" + + def self.prettify(string) + $last_prettify_file_count = -1 + $last_prettify_part_count = { "remove" => 0, "add" => 0, "shared" => 0, "binary" => 0, "extract-error" => 0 } + string = normalize_line_ending(string) + str = "#{HEADER}\n" + + # Just look at the first line to see if it is an SVN revision number as added + # by webkit-patch for git checkouts. + $svn_revision = 0 + string.each_line do |line| + match = /^Subversion\ Revision: (\d*)$/.match(line) + unless match.nil? + str << "#{match[1]}\n" + $svn_revision = match[1].to_i; + end + break + end + + fileDiffs = FileDiff.parse(string) + + $last_prettify_file_count = fileDiffs.length + str << fileDiffs.collect{ |diff| diff.to_html }.join + str << "" + end + + def self.filename_from_diff_header(line) + DIFF_HEADER_FORMATS.each do |format| + match = format.match(line) + return match[1] unless match.nil? + end + nil + end + + def self.diff_header?(line) + RELAXED_DIFF_HEADER_FORMATS.any? { |format| line =~ format } + end + +private + DIFF_HEADER_FORMATS = [ + /^Index: (.*)\r?$/, + /^diff --git "?a\/.+"? "?b\/(.+)"?\r?$/, + /^\+\+\+ ([^\t]+)(\t.*)?\r?$/ + ] + + RELAXED_DIFF_HEADER_FORMATS = [ + /^Index:/, + /^diff/ + ] + + BINARY_FILE_MARKER_FORMAT = /^Cannot display: file marked as a binary type.$/ + + IMAGE_FILE_MARKER_FORMAT = /^svn:mime-type = image\/png$/ + + GIT_INDEX_MARKER_FORMAT = /^index ([0-9a-f]{40})\.\.([0-9a-f]{40})/ + + GIT_BINARY_FILE_MARKER_FORMAT = /^GIT binary patch$/ + + GIT_BINARY_PATCH_FORMAT = /^(literal|delta) \d+$/ + + GIT_LITERAL_FORMAT = /^literal \d+$/ + + GIT_DELTA_FORMAT = /^delta \d+$/ + + START_OF_BINARY_DATA_FORMAT = /^[0-9a-zA-Z\+\/=]{20,}/ # Assume 20 chars without a space is base64 binary data. + + START_OF_SECTION_FORMAT = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@\s*(.*)/ + + START_OF_EXTENT_STRING = "%c" % 0 + END_OF_EXTENT_STRING = "%c" % 1 + + # We won't search for intra-line diffs in lines longer than this length, to avoid hangs. See . + MAXIMUM_INTRALINE_DIFF_LINE_LENGTH = 10000 + + SMALLEST_EQUAL_OPERATION = 3 + + OPENSOURCE_URL = "http://src.chromium.org/viewvc/blink/" + + OPENSOURCE_DIRS = Set.new %w[ + tests + PerformanceTests + engine + Tools + ] + + IMAGE_CHECKSUM_ERROR = "INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests." + + def self.normalize_line_ending(s) + if RUBY_VERSION >= "1.9" + # Transliteration table from http://stackoverflow.com/a/6609998 + transliteration_table = { '\xc2\x82' => ',', # High code comma + '\xc2\x84' => ',,', # High code double comma + '\xc2\x85' => '...', # Tripple dot + '\xc2\x88' => '^', # High carat + '\xc2\x91' => '\x27', # Forward single quote + '\xc2\x92' => '\x27', # Reverse single quote + '\xc2\x93' => '\x22', # Forward double quote + '\xc2\x94' => '\x22', # Reverse double quote + '\xc2\x95' => ' ', + '\xc2\x96' => '-', # High hyphen + '\xc2\x97' => '--', # Double hyphen + '\xc2\x99' => ' ', + '\xc2\xa0' => ' ', + '\xc2\xa6' => '|', # Split vertical bar + '\xc2\xab' => '<<', # Double less than + '\xc2\xbb' => '>>', # Double greater than + '\xc2\xbc' => '1/4', # one quarter + '\xc2\xbd' => '1/2', # one half + '\xc2\xbe' => '3/4', # three quarters + '\xca\xbf' => '\x27', # c-single quote + '\xcc\xa8' => '', # modifier - under curve + '\xcc\xb1' => '' # modifier - under line + } + encoded_string = s.force_encoding('UTF-8').encode('UTF-16', :invalid => :replace, :replace => '', :fallback => transliteration_table).encode('UTF-8') + encoded_string.gsub /\r\n?/, "\n" + else + s.gsub /\r\n?/, "\n" + end + end + + def self.find_url_and_path(file_path) + # Search file_path from the bottom up, at each level checking whether + # we've found a directory we know exists in the source tree. + + dirname, basename = File.split(file_path) + dirname.split(/\//).reverse.inject(basename) do |path, directory| + path = directory + "/" + path + + return [OPENSOURCE_URL, path] if OPENSOURCE_DIRS.include?(directory) + + path + end + + [nil, file_path] + end + + def self.linkifyFilename(filename) + url, pathBeneathTrunk = find_url_and_path(filename) + + url.nil? ? filename : "#{filename}" + end + + + HEADER =< + + + +EOF + + def self.revisionOrDescription(string) + case string + when /\(revision \d+\)/ + /\(revision (\d+)\)/.match(string)[1] + when /\(.*\)/ + /\((.*)\)/.match(string)[1] + end + end + + def self.has_image_suffix(filename) + filename =~ /\.(png|jpg|gif)$/ + end + + class FileDiff + def initialize(lines) + @filename = PrettyPatch.filename_from_diff_header(lines[0].chomp) + startOfSections = 1 + for i in 0...lines.length + case lines[i] + when /^--- / + @from = PrettyPatch.revisionOrDescription(lines[i]) + when /^\+\+\+ / + @filename = PrettyPatch.filename_from_diff_header(lines[i].chomp) if @filename.nil? + @to = PrettyPatch.revisionOrDescription(lines[i]) + startOfSections = i + 1 + break + when BINARY_FILE_MARKER_FORMAT + @binary = true + if (IMAGE_FILE_MARKER_FORMAT.match(lines[i + 1]) or PrettyPatch.has_image_suffix(@filename)) then + @image = true + startOfSections = i + 2 + for x in startOfSections...lines.length + # Binary diffs often have property changes listed before the actual binary data. Skip them. + if START_OF_BINARY_DATA_FORMAT.match(lines[x]) then + startOfSections = x + break + end + end + end + break + when GIT_INDEX_MARKER_FORMAT + @git_indexes = [$1, $2] + when GIT_BINARY_FILE_MARKER_FORMAT + @binary = true + if (GIT_BINARY_PATCH_FORMAT.match(lines[i + 1]) and PrettyPatch.has_image_suffix(@filename)) then + @git_image = true + startOfSections = i + 1 + end + break + end + end + lines_with_contents = lines[startOfSections...lines.length] + @sections = DiffSection.parse(lines_with_contents) unless @binary + if @image and not lines_with_contents.empty? + @image_url = "data:image/png;base64," + lines_with_contents.join + @image_checksum = FileDiff.read_checksum_from_png(lines_with_contents.join.unpack("m").join) + elsif @git_image + begin + raise "index line is missing" unless @git_indexes + + chunks = nil + for i in 0...lines_with_contents.length + if lines_with_contents[i] =~ /^$/ + chunks = [lines_with_contents[i + 1 .. -1], lines_with_contents[0 .. i]] + break + end + end + + raise "no binary chunks" unless chunks + + from_filepath = FileDiff.extract_contents_of_from_revision(@filename, chunks[0], @git_indexes[0]) + to_filepath = FileDiff.extract_contents_of_to_revision(@filename, chunks[1], @git_indexes[1], from_filepath, @git_indexes[0]) + filepaths = from_filepath, to_filepath + + binary_contents = filepaths.collect { |filepath| File.exists?(filepath) ? File.read(filepath) : nil } + @image_urls = binary_contents.collect { |content| (content and not content.empty?) ? "data:image/png;base64," + [content].pack("m") : nil } + @image_checksums = binary_contents.collect { |content| FileDiff.read_checksum_from_png(content) } + rescue + $last_prettify_part_count["extract-error"] += 1 + @image_error = "Exception raised during decoding git binary patch:
#{CGI.escapeHTML($!.to_s + "\n" + $!.backtrace.join("\n"))}
" + ensure + File.unlink(from_filepath) if (from_filepath and File.exists?(from_filepath)) + File.unlink(to_filepath) if (to_filepath and File.exists?(to_filepath)) + end + end + nil + end + + def image_to_html + if not @image_url then + return "Image file removed" + end + + image_checksum = "" + if @image_checksum + image_checksum = @image_checksum + elsif @filename.include? "-expected.png" and @image_url + image_checksum = IMAGE_CHECKSUM_ERROR + end + + return "

" + image_checksum + "

" + end + + def to_html + str = "
\n" + str += "

#{PrettyPatch.linkifyFilename(@filename)}

\n" + if @image then + str += self.image_to_html + elsif @git_image then + if @image_error + str += @image_error + else + for i in (0...2) + image_url = @image_urls[i] + image_checksum = @image_checksums[i] + + style = ["remove", "add"][i] + str += "

" + + if image_checksum + str += image_checksum + elsif @filename.include? "-expected.png" and image_url + str += IMAGE_CHECKSUM_ERROR + end + + str += "
" + + if image_url + str += "" + else + str += ["

Added", "

Removed"][i] + end + end + end + elsif @binary then + $last_prettify_part_count["binary"] += 1 + str += "Binary file, nothing to see here" + else + str += @sections.collect{ |section| section.to_html }.join("
\n") unless @sections.nil? + end + + if @from then + str += "" + @from + "" + end + + str += "
\n" + end + + def self.parse(string) + haveSeenDiffHeader = false + linesForDiffs = [] + string.each_line do |line| + if (PrettyPatch.diff_header?(line)) + linesForDiffs << [] + haveSeenDiffHeader = true + elsif (!haveSeenDiffHeader && line =~ /^--- /) + linesForDiffs << [] + haveSeenDiffHeader = false + end + linesForDiffs.last << line unless linesForDiffs.last.nil? + end + + linesForDiffs.collect { |lines| FileDiff.new(lines) } + end + + def self.read_checksum_from_png(png_bytes) + # Ruby 1.9 added the concept of string encodings, so to avoid treating binary data as UTF-8, + # we can force the encoding to binary at this point. + if RUBY_VERSION >= "1.9" + png_bytes.force_encoding('binary') + end + match = png_bytes && png_bytes.match(/tEXtchecksum\0([a-fA-F0-9]{32})/) + match ? match[1] : nil + end + + def self.git_new_file_binary_patch(filename, encoded_chunk, git_index) + return <= 1 or raise "DiffSection.parse only received %d lines" % lines.length + + matches = START_OF_SECTION_FORMAT.match(lines[0]) + + if matches + from, to = [matches[1].to_i, matches[3].to_i] + if matches[2] and matches[4] + from_end = from + matches[2].to_i + to_end = to + matches[4].to_i + end + end + + @blocks = [] + diff_block = nil + diff_block_part = nil + + for line in lines[1...lines.length] + startOfLine = line =~ /^[-\+ ]/ ? 1 : 0 + text = line[startOfLine...line.length].chomp + case line[0] + when ?- + if (diff_block_part.nil? or diff_block_part.className != 'remove') + diff_block = DiffBlock.new(@blocks) + diff_block_part = DiffBlockPart.new('remove', diff_block) + end + + diff_block_part.lines << CodeLine.new(from, nil, text) + from += 1 unless from.nil? + when ?+ + if (diff_block_part.nil? or diff_block_part.className != 'add') + # Put add lines that immediately follow remove lines into the same DiffBlock. + if (diff_block.nil? or diff_block_part.className != 'remove') + diff_block = DiffBlock.new(@blocks) + end + + diff_block_part = DiffBlockPart.new('add', diff_block) + end + + diff_block_part.lines << CodeLine.new(nil, to, text) + to += 1 unless to.nil? + else + if (diff_block_part.nil? or diff_block_part.className != 'shared') + diff_block = DiffBlock.new(@blocks) + diff_block_part = DiffBlockPart.new('shared', diff_block) + end + + diff_block_part.lines << CodeLine.new(from, to, text) + from += 1 unless from.nil? + to += 1 unless to.nil? + end + + break if from_end and to_end and from == from_end and to == to_end + end + + changes = [ [ [], [] ] ] + for block in @blocks + for block_part in block.parts + for line in block_part.lines + if (!line.fromLineNumber.nil? and !line.toLineNumber.nil?) then + changes << [ [], [] ] + next + end + changes.last.first << line if line.toLineNumber.nil? + changes.last.last << line if line.fromLineNumber.nil? + end + end + end + + for change in changes + next unless change.first.length == change.last.length + for i in (0...change.first.length) + from_text = change.first[i].text + to_text = change.last[i].text + next if from_text.length > MAXIMUM_INTRALINE_DIFF_LINE_LENGTH or to_text.length > MAXIMUM_INTRALINE_DIFF_LINE_LENGTH + raw_operations = HTMLDiff::DiffBuilder.new(from_text, to_text).operations + operations = [] + back = 0 + raw_operations.each_with_index do |operation, j| + if operation.action == :equal and j < raw_operations.length - 1 + length = operation.end_in_new - operation.start_in_new + if length < SMALLEST_EQUAL_OPERATION + back = length + next + end + end + operation.start_in_old -= back + operation.start_in_new -= back + back = 0 + operations << operation + end + change.first[i].operations = operations + change.last[i].operations = operations + end + end + + @blocks.unshift(ContextLine.new(matches[5])) unless matches.nil? || matches[5].empty? + end + + def to_html + str = "
\n" + str += @blocks.collect{ |block| block.to_html }.join + str += "
\n" + end + + def self.parse(lines) + linesForSections = lines.inject([[]]) do |sections, line| + sections << [] if line =~ /^@@/ + sections.last << line + sections + end + + linesForSections.delete_if { |lines| lines.nil? or lines.empty? } + linesForSections.collect { |lines| DiffSection.new(lines) } + end + end + + class Line + attr_reader :fromLineNumber + attr_reader :toLineNumber + attr_reader :text + + def initialize(from, to, text) + @fromLineNumber = from + @toLineNumber = to + @text = text + end + + def text_as_html + CGI.escapeHTML(text) + end + + def classes + lineClasses = ["Line", "LineContainer"] + lineClasses << ["add"] unless @toLineNumber.nil? or !@fromLineNumber.nil? + lineClasses << ["remove"] unless @fromLineNumber.nil? or !@toLineNumber.nil? + lineClasses + end + + def to_html + markedUpText = self.text_as_html + str = "
\n" % self.classes.join(' ') + str += "%s%s" % + [@fromLineNumber.nil? ? ' ' : @fromLineNumber, + @toLineNumber.nil? ? ' ' : @toLineNumber] unless @fromLineNumber.nil? and @toLineNumber.nil? + str += "%s\n" % markedUpText + str += "
\n" + end + end + + class CodeLine < Line + attr :operations, true + + def text_as_html + html = [] + tag = @fromLineNumber.nil? ? "ins" : "del" + if @operations.nil? or @operations.empty? + return CGI.escapeHTML(@text) + end + @operations.each do |operation| + start = @fromLineNumber.nil? ? operation.start_in_new : operation.start_in_old + eend = @fromLineNumber.nil? ? operation.end_in_new : operation.end_in_old + escaped_text = CGI.escapeHTML(@text[start...eend]) + if eend - start === 0 or operation.action === :equal + html << escaped_text + else + html << "<#{tag}>#{escaped_text}" + end + end + html.join + end + end + + class ContextLine < Line + def initialize(context) + super("@", "@", context) + end + + def classes + super << "context" + end + end +end diff --git a/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch_test.rb b/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch_test.rb new file mode 100755 index 0000000000..0d5f94395a --- /dev/null +++ b/engine/src/flutter/tools/third_party/PrettyPatch/PrettyPatch_test.rb @@ -0,0 +1,99 @@ +#!/usr/bin/ruby + +require 'test/unit' +require 'open-uri' +require 'PrettyPatch' + +# Note: internet connection is needed to run this test suite. + +class PrettyPatch_test < Test::Unit::TestCase + class Info + TITLE = 0 + FILE = 1 + ADD = 2 + REMOVE = 3 + SHARED = 4 + end + + PATCHES = { + 20510 => ["Single change", 1, 1, 0, 2], + 20528 => ["No 'Index' or 'diff' in patch header", 1, 4, 3, 7], + 21151 => ["Leading '/' in the path of files", 4, 9, 1, 16], + # Binary files use shared blocks, there are three in 30488. + 30488 => ["Quoted filenames in git diff", 23, 28, 25, 64 + 3], + 23920 => ["Mac line ending", 3, 3, 0, 5], + 39615 => ["Git signature", 2, 2, 0, 3], + 80852 => ["Changes one line plus ChangeLog", 2, 2, 1, 4], + 83127 => ["Only add stuff", 2, 2, 0, 3], + 85071 => ["Adds and removes from a file plus git signature", 2, 5, 3, 9], + 106368 => ["Images with git delta binary patch", 69, 8, 23, 10], + } + + def get_patch_uri(id) + "https://bugs.webkit.org/attachment.cgi?id=" + id.to_s + end + + def get_patch(id) + result = nil + patch_uri = get_patch_uri(id) + begin + result = open(patch_uri) { |f| result = f.read } + rescue => exception + assert(false, "Fail to get patch " + patch_uri) + end + result + end + + def check_one_patch(id, info) + patch = get_patch(id) + description = get_patch_uri(id) + description += " (" + info[Info::TITLE] + ")" unless info[Info::TITLE].nil? + puts "Testing " + description + pretty = nil + assert_nothing_raised("Crash while prettifying " + description) { + pretty = PrettyPatch.prettify(patch) + } + assert(pretty, "Empty result while prettifying " + description) + assert_equal(info[Info::FILE], $last_prettify_file_count, "Wrong number of files changed in " + description) + assert_equal(info[Info::ADD], $last_prettify_part_count["add"], "Wrong number of 'add' parts in " + description) + assert_equal(info[Info::REMOVE], $last_prettify_part_count["remove"], "Wrong number of 'remove' parts in " + description) + assert_equal(info[Info::SHARED], $last_prettify_part_count["shared"], "Wrong number of 'shared' parts in " + description) + assert_equal(0, $last_prettify_part_count["binary"], "Wrong number of 'binary' parts in " + description) + assert_equal(0, $last_prettify_part_count["extract-error"], "Wrong number of 'extract-error' parts in " + description) + return pretty + end + + def test_patches + PATCHES.each { |id, info| check_one_patch(id, info) } + end + + def test_images_without_checksum + pretty = check_one_patch(144064, ["Images without checksums", 10, 5, 4, 8]) + matches = pretty.match("INVALID: Image lacks a checksum.") + # FIXME: This should match, but there's a bug when running the tests where the image data + # doesn't get properly written out to the temp files, so there is no image and we don't print + # the warning that the image is missing its checksum. + assert(!matches, "Should have invalid checksums") + # FIXME: This should only have 4 invalid images, but due to the above tempfile issue, there are 0. + assert_equal(0, pretty.scan(/INVALID\: Image lacks a checksum\./).size) + end + + def test_new_image + pretty = check_one_patch(145881, ["New image", 19, 36, 19, 56]) + matches = pretty.match("INVALID: Image lacks a checksum.") + assert(!matches, "Should not have invalid checksums") + end + + def test_images_correctly_without_checksum_git + pretty = check_one_patch(101620, ["Images correctly without checksums git", 7, 15, 10, 26]) + matches = pretty.match("INVALID: Image lacks a checksum.") + assert(!matches, "Png should lack a checksum without an error.") + end + + def test_images_correctly_without_checksum_svn + pretty = check_one_patch(31202, ["Images correctly without checksums svn", 4, 4, 1, 4]) + matches = pretty.match("INVALID: Image lacks a checksum.") + assert(!matches, "Png should lack a checksum without an error.") + end + +end diff --git a/engine/src/flutter/tools/third_party/PrettyPatch/diff.rb b/engine/src/flutter/tools/third_party/PrettyPatch/diff.rb new file mode 100644 index 0000000000..e5c154a616 --- /dev/null +++ b/engine/src/flutter/tools/third_party/PrettyPatch/diff.rb @@ -0,0 +1,164 @@ +module HTMLDiff + + Match = Struct.new(:start_in_old, :start_in_new, :size) + class Match + def end_in_old + self.start_in_old + self.size + end + + def end_in_new + self.start_in_new + self.size + end + end + + Operation = Struct.new(:action, :start_in_old, :end_in_old, :start_in_new, :end_in_new) + + class DiffBuilder + + def initialize(old_version, new_version) + @old_version, @new_version = old_version, new_version + split_inputs_to_words + index_new_words + end + + def split_inputs_to_words + @old_words = explode(@old_version) + @new_words = explode(@new_version) + end + + def index_new_words + @word_indices = Hash.new { |h, word| h[word] = [] } + @new_words.each_with_index { |word, i| @word_indices[word] << i } + end + + def operations + position_in_old = position_in_new = 0 + operations = [] + + matches = matching_blocks + # an empty match at the end forces the loop below to handle the unmatched tails + # I'm sure it can be done more gracefully, but not at 23:52 + matches << Match.new(@old_words.length, @new_words.length, 0) + + matches.each_with_index do |match, i| + match_starts_at_current_position_in_old = (position_in_old == match.start_in_old) + match_starts_at_current_position_in_new = (position_in_new == match.start_in_new) + + action_upto_match_positions = + case [match_starts_at_current_position_in_old, match_starts_at_current_position_in_new] + when [false, false] + :replace + when [true, false] + :insert + when [false, true] + :delete + else + # this happens if the first few words are same in both versions + :none + end + + if action_upto_match_positions != :none + operation_upto_match_positions = + Operation.new(action_upto_match_positions, + position_in_old, match.start_in_old, + position_in_new, match.start_in_new) + operations << operation_upto_match_positions + end + if match.size != 0 + match_operation = Operation.new(:equal, + match.start_in_old, match.end_in_old, + match.start_in_new, match.end_in_new) + operations << match_operation + end + + position_in_old = match.end_in_old + position_in_new = match.end_in_new + end + + operations + end + + def matching_blocks + matching_blocks = [] + recursively_find_matching_blocks(0, @old_words.size, 0, @new_words.size, matching_blocks) + matching_blocks + end + + def recursively_find_matching_blocks(start_in_old, end_in_old, start_in_new, end_in_new, matching_blocks) + match = find_match(start_in_old, end_in_old, start_in_new, end_in_new) + if match + if start_in_old < match.start_in_old and start_in_new < match.start_in_new + recursively_find_matching_blocks( + start_in_old, match.start_in_old, start_in_new, match.start_in_new, matching_blocks) + end + matching_blocks << match + if match.end_in_old < end_in_old and match.end_in_new < end_in_new + recursively_find_matching_blocks( + match.end_in_old, end_in_old, match.end_in_new, end_in_new, matching_blocks) + end + end + end + + def find_match(start_in_old, end_in_old, start_in_new, end_in_new) + + best_match_in_old = start_in_old + best_match_in_new = start_in_new + best_match_size = 0 + + match_length_at = Hash.new { |h, index| h[index] = 0 } + + start_in_old.upto(end_in_old - 1) do |index_in_old| + + new_match_length_at = Hash.new { |h, index| h[index] = 0 } + + @word_indices[@old_words[index_in_old]].each do |index_in_new| + next if index_in_new < start_in_new + break if index_in_new >= end_in_new + + new_match_length = match_length_at[index_in_new - 1] + 1 + new_match_length_at[index_in_new] = new_match_length + + if new_match_length > best_match_size + best_match_in_old = index_in_old - new_match_length + 1 + best_match_in_new = index_in_new - new_match_length + 1 + best_match_size = new_match_length + end + end + match_length_at = new_match_length_at + end + +# best_match_in_old, best_match_in_new, best_match_size = add_matching_words_left( +# best_match_in_old, best_match_in_new, best_match_size, start_in_old, start_in_new) +# best_match_in_old, best_match_in_new, match_size = add_matching_words_right( +# best_match_in_old, best_match_in_new, best_match_size, end_in_old, end_in_new) + + return (best_match_size != 0 ? Match.new(best_match_in_old, best_match_in_new, best_match_size) : nil) + end + + def add_matching_words_left(match_in_old, match_in_new, match_size, start_in_old, start_in_new) + while match_in_old > start_in_old and + match_in_new > start_in_new and + @old_words[match_in_old - 1] == @new_words[match_in_new - 1] + match_in_old -= 1 + match_in_new -= 1 + match_size += 1 + end + [match_in_old, match_in_new, match_size] + end + + def add_matching_words_right(match_in_old, match_in_new, match_size, end_in_old, end_in_new) + while match_in_old + match_size < end_in_old and + match_in_new + match_size < end_in_new and + @old_words[match_in_old + match_size] == @new_words[match_in_new + match_size] + match_size += 1 + end + [match_in_old, match_in_new, match_size] + end + + def explode(sequence) + sequence.is_a?(String) ? sequence.split(//) : sequence + end + + end # of class Diff Builder + +end diff --git a/engine/src/flutter/tools/third_party/PrettyPatch/prettify.rb b/engine/src/flutter/tools/third_party/PrettyPatch/prettify.rb new file mode 100755 index 0000000000..a9c211fbe1 --- /dev/null +++ b/engine/src/flutter/tools/third_party/PrettyPatch/prettify.rb @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby + +require 'optparse' +require 'pathname' +require 'webrick/htmlutils' + +$LOAD_PATH << Pathname.new(__FILE__).dirname.realpath.to_s + +require 'PrettyPatch' + +BACKTRACE_SEPARATOR = "\n\tfrom " + +options = { :html_exceptions => false } +OptionParser.new do |opts| + opts.banner = "Usage: #{File.basename($0)} [options] [patch-file]" + + opts.separator "" + + opts.on("--html-exceptions", "Print exceptions to stdout as HTML") { |h| options[:html_exceptions] = h } +end.parse! + +patch_data = nil +if ARGV.length == 0 || ARGV[0] == '-' then + patch_data = $stdin.read +else + File.open(ARGV[0]) { |file| patch_data = file.read } +end + +begin + puts PrettyPatch.prettify(patch_data) +rescue => exception + raise unless options[:html_exceptions] + + backtrace = exception.backtrace + backtrace[0] += ": " + exception + " (" + exception.class.to_s + ")" + print "
\n", WEBrick::HTMLUtils::escape(backtrace.join(BACKTRACE_SEPARATOR)), "\n
\n" +end diff --git a/engine/src/flutter/tools/webkit-patch b/engine/src/flutter/tools/webkit-patch new file mode 100755 index 0000000000..2ed9d8daef --- /dev/null +++ b/engine/src/flutter/tools/webkit-patch @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Code Aurora Forum. All rights reserved. +# Copyright (c) 2010 Google Inc. All rights reserved. +# Copyright (c) 2009 Apple Inc. All rights reserved. +# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# A tool for automating dealing with bugzilla, posting patches, committing patches, etc. + +import logging +import os +import signal +import sys +import codecs + +import webkitpy.common.version_check + +from webkitpy.common.system.logutils import configure_logging +from webkitpy.tool.main import WebKitPatch + +# A StreamWriter will by default try to encode all objects passed +# to write(), so when passed a raw string already encoded as utf8, +# it will blow up with an UnicodeDecodeError. This does not match +# the default behaviour of writing to sys.stdout, so we intercept +# the case of writing raw strings and make sure StreamWriter gets +# input that it can handle. +class ForgivingUTF8Writer(codecs.lookup('utf-8')[-1]): + def write(self, object): + if isinstance(object, str): + # Assume raw strings are utf-8 encoded. If this line + # fails with an UnicodeDecodeError, our assumption was + # wrong, and the stacktrace should show you where we + # write non-Unicode/UTF-8 data (which we shouldn't). + object = object.decode('utf-8') + return codecs.StreamWriter.write(self, object) + +# By default, sys.stdout assumes ascii encoding. Since our messages can +# contain unicode strings (as with some peoples' names) we need to apply +# the utf-8 codec to prevent throwing and exception. +# Not having this was the cause of https://bugs.webkit.org/show_bug.cgi?id=63452. +sys.stdout = ForgivingUTF8Writer(sys.stdout) + +_log = logging.getLogger("webkit-patch") + +def main(): + # This is a hack to let us enable DEBUG logging as early as possible. + # Note this can't be ternary as versioning.check_version() + # hasn't run yet and this python might be older than 2.5. + if set(["-v", "--verbose"]).intersection(set(sys.argv)): + logging_level = logging.DEBUG + else: + logging_level = logging.INFO + configure_logging(logging_level=logging_level) + WebKitPatch(os.path.abspath(__file__)).main() + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(signal.SIGINT + 128)