From 3c8baa179ff799c440aa6ee53297ab9e0de74602 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 11:05:40 -0700 Subject: [PATCH 001/732] Add a README.md for Sky R=jamesr@chromium.org Review URL: https://codereview.chromium.org/672963002 --- engine/src/flutter/README.md | 152 +++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 engine/src/flutter/README.md diff --git a/engine/src/flutter/README.md b/engine/src/flutter/README.md new file mode 100644 index 0000000000..b750fc08dc --- /dev/null +++ b/engine/src/flutter/README.md @@ -0,0 +1,152 @@ +Sky +=== + +Sky is an experiment in building a UI framework for Mojo. The approach we're +exploring is to create a layered framework based around a retained hierarchy of +semantic elements. We're experimenting with different ideas and exploring +various approaches, many of which won't work and will need to be discarded, but, +if we're lucky, some of which might turn out to be useful. + +Sky has three layers, each of which also adds progressively more opinion. At +the lowest layer, Sky contains a rendering engine that parses markup, executes +script, and applies styling information. Layered above the engine is a +collection of components that define the interactive behavior of a suite of +widgets, such as input fields, buttons, and menus. Above the widget layer is a +theme layer that gives each widget a concrete visual and interactive design. + +Elements +-------- + +The Sky engine contains a handful of primitive elements and the tools with which +to create custom elements. The following elements are built into the engine: + + - ``script``: Executes script + - ``style``: Defines style rules + - ``import``: Loads a module + - ``iframe``: Embeds another Mojo application + - ``template``: Captures descendants for use as a template + - ``content``: Visually projects descendents of the shadow host + - ``shadow``: Visually projects older shadow roots of the shadow host + - ``image``: Displays an image + - ``a``: Links to another Mojo application + - ``title``: Briefly describes the current application state to the user + +### Additional Elements ### + +In addition to the built-in elements, frameworks and applications can define +custom elements. The Sky framework contains a number of general-purpose +elements, including ``input``, ``button``, ``menu``, ``toolbar``, ``video``, and +``dialog``. However, developers are free to implement their own input fields, +buttons, menus, toolbars, videos, or dialogs with access to all the same engine +features as the frame because the framework does not occupy a privileged +position in Sky. + +### Custom Layout ### + +TODO: Describe the approach for customizing layout. + +### Custom Painting ### + +TODO: Describe the approach for customizing painting. + +Modules +------- + +Sky applications consist of a collection of modules. Each module can describe +its dependencies, register custom elements, and export objects for use in other +modules. + +Below is a sketch of a typical module. The first ``import`` element imports the +Sky framework, which defines the ``sky-element`` element. This module then uses +``sky-element`` to define another element, ``my-element``. The second ``import`` +element imports another module and gives it the name ``foo`` within this module. +For example, the ``AnnualReport`` constructor uses the ``BalanceSheet`` class +exported by that module. + +```html + + + + [ ... custom element definition ... ] + + +``` + +The script definitions are local to each module and cannot be referenced by +other modules unless exported. For example, the ``mult`` function is private to +this module whereas the ``multiplyByTwo`` function can be used by other modules +because it is exported. Similarly, this module exports the ``AnnualReport`` +class. + +Services +-------- + +Sky applications can access Mojo services and can provide services to other Mojo +applications. For example, Sky applications can access the network using Mojo's +``network_service``. Typically, however, Sky applications access services via +frameworks that provide idiomatic interfaces to the underlying Mojo services. +These idiomatic interfaces are layered on top of the underlying Mojo service, +and developers are free to use the underlying service directly. + +As an example, the following is a sketch of a module that wraps Mojo's +``network_service`` in a simpler functional interface: + +```html + + + + +``` + +Notice that the ``shell`` module is built-in and provides access to the +underlying Mojo fabric but the ``net`` and ``loader`` modules run inside Sky and +encode and decode messages sent over Mojo pipes. + +Specifications +-------------- + +TODO: Link to the specs. + +Contributing +------------ + +TODO: Link to HACKING.md, which contains the instructions for hacking on Sky. +TODO: Link to mailing list and IRC channel. From b3df23f7c18a148717e7c4892af3e8c4882787a0 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 11:15:41 -0700 Subject: [PATCH 002/732] 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) From a3ca0e52d66e881250e7d1d8fa83ad0806419abd Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 11:29:54 -0700 Subject: [PATCH 003/732] Add Sky to the build system R=esprehn@chromium.org Review URL: https://codereview.chromium.org/657863003 --- engine/src/flutter/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index c496af3d9d..d0127988af 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -12,7 +12,6 @@ group("sky") { "//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", From 546708872d20fcc6bf49bc54b9539ebe39a2ba79 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 12:02:07 -0700 Subject: [PATCH 004/732] Add another missing dependency --- engine/src/flutter/tools/debugger/BUILD.gn | 2 -- engine/src/flutter/tools/debugger/prompt/BUILD.gn | 2 +- engine/src/flutter/tools/tester/BUILD.gn | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/tools/debugger/BUILD.gn b/engine/src/flutter/tools/debugger/BUILD.gn index 59de1cca1c..75063e29e9 100644 --- a/engine/src/flutter/tools/debugger/BUILD.gn +++ b/engine/src/flutter/tools/debugger/BUILD.gn @@ -14,8 +14,6 @@ group("debugger") { } shared_library("sky_debugger") { - output_name = "mojo_sky_debugger" - sources = [ "debugger.cc", "focus_rules.cc", diff --git a/engine/src/flutter/tools/debugger/prompt/BUILD.gn b/engine/src/flutter/tools/debugger/prompt/BUILD.gn index 76412c8077..ff6f82bd47 100644 --- a/engine/src/flutter/tools/debugger/prompt/BUILD.gn +++ b/engine/src/flutter/tools/debugger/prompt/BUILD.gn @@ -3,7 +3,7 @@ # found in the LICENSE file. shared_library("prompt") { - output_name = "mojo_sky_debugger_prompt" + output_name = "sky_debugger_prompt" sources = [ "prompt.cc", diff --git a/engine/src/flutter/tools/tester/BUILD.gn b/engine/src/flutter/tools/tester/BUILD.gn index 93e0985f09..d4e0b6bc9c 100644 --- a/engine/src/flutter/tools/tester/BUILD.gn +++ b/engine/src/flutter/tools/tester/BUILD.gn @@ -3,7 +3,7 @@ # found in the LICENSE file. shared_library("tester") { - output_name = "mojo_sky_tester" + output_name = "sky_tester" sources = [ "test_harness.cc", From 4a2c99c0ecf132fa56243f510c012dc6ce015f25 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 12:19:02 -0700 Subject: [PATCH 005/732] Update TestExpectations to match reality R=esprehn@chromium.org Review URL: https://codereview.chromium.org/671633005 --- engine/src/flutter/tests/TestExpectations | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/src/flutter/tests/TestExpectations b/engine/src/flutter/tests/TestExpectations index fdd431e6c5..0547a15665 100644 --- a/engine/src/flutter/tests/TestExpectations +++ b/engine/src/flutter/tests/TestExpectations @@ -7,3 +7,8 @@ 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 ] + +# We need to land the new inspector backend +Bug(abarth) inspector [ Skip ] + +Bug(abarth) services/network.html [ Crash ] From 9f5a253a9ea8447e96dbd6e39fcf3622aa1c8d64 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 13:40:48 -0700 Subject: [PATCH 006/732] Teach tools/skydb how to take a URL as a parameter. Turns out our shut-down code in debugger.cc is never called. Need to talk to Ben to figure out how to listen for the CloseWindow. R=abarth@chromium.org Review URL: https://codereview.chromium.org/658113004 --- engine/src/flutter/tools/debugger/debugger.cc | 2 ++ .../flutter/tools/debugger/prompt/prompt.cc | 6 +++- engine/src/flutter/tools/skydb | 31 +++++++++++++------ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index 8b0e0d14cf..e4aa111a0a 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -74,11 +74,13 @@ class SkyDebugger : public mojo::ApplicationDelegate, virtual void OnViewManagerDisconnected( mojo::ViewManager* view_manager) override { + CHECK(false); // FIXME: This is dead code, why? view_manager_ = nullptr; root_ = nullptr; } virtual void OnViewDestroyed(mojo::View* view) override { + CHECK(false); // FIXME: This is dead code, why? view->RemoveObserver(this); } diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index 60d6733802..3b486045e6 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -43,12 +43,16 @@ class Prompt : public mojo::ApplicationDelegate { // Overridden from mojo::ApplicationDelegate: virtual void Initialize(mojo::ApplicationImpl* app) override { app->ConnectToService("mojo:sky_viewer", &tracing_); - ScheduleWaitForInput(); + if (app->args().size() > 1) + url_ = app->args()[1]; } virtual bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override { connection->ConnectToService(&debugger_); + if (!url_.empty()) + Reload(); + ScheduleWaitForInput(); return true; } diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index 5c3af21c83..406e482609 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -5,16 +5,27 @@ import os import subprocess +import sys -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')) +BUILD_DIRECTORY = 'out' +CONFIG_DIRECTORY = 'Debug' +MOJO_SHELL_PATH = 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', -]) +def main(args): + shell_command = [ + MOJO_SHELL_PATH, + '--v=1', + '--content-handlers=text/html,mojo://sky_viewer/', + '--url-mappings=mojo:window_manager=mojo:sky_debugger', + 'mojo:window_manager', + ] + if args: + prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % args[0] + shell_command.append(prompt_args) + subprocess.check_call(shell_command) + + +if __name__ == '__main__': + main(sys.argv[1:]) From e6903a0867f29a4de5c42db535795eb787f83048 Mon Sep 17 00:00:00 2001 From: Hixie Date: Thu, 23 Oct 2014 13:42:24 -0700 Subject: [PATCH 007/732] Placeholder Sky start page. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/677513002 --- engine/src/flutter/examples/home.sky | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 engine/src/flutter/examples/home.sky diff --git a/engine/src/flutter/examples/home.sky b/engine/src/flutter/examples/home.sky new file mode 100644 index 0000000000..3a447fd3db --- /dev/null +++ b/engine/src/flutter/examples/home.sky @@ -0,0 +1,7 @@ +#!mojo mojo:sky + +

about:blank

+

Welcome to Sky!

From 63a8a02db207f900e2c6581f776d9fab2a9d19f3 Mon Sep 17 00:00:00 2001 From: James Robinson Date: Thu, 23 Oct 2014 14:50:37 -0700 Subject: [PATCH 008/732] Fix sky build on android R=abarth@chromium.org Review URL: https://codereview.chromium.org/678533002 --- engine/src/flutter/BUILD.gn | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index d0127988af..4fcf804016 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/ui.gni") import("//tools/grit/grit_rule.gni") group("sky") { @@ -12,9 +13,15 @@ group("sky") { "//sky/engine/platform:platform_unittests", "//sky/engine/web:sky_unittests", "//sky/engine/wtf:unittests", - "//sky/tools/debugger", - "//sky/tools/tester", "//sky/viewer", - "//third_party/mesa:osmesa", ] + if (use_aura) { + deps += [ + "//sky/tools/debugger", + "//sky/tools/tester", + ] + } + if (!is_android) { + deps += [ "//third_party/mesa:osmesa" ] + } } From 3c84485f2ae36070b4c7489fd77a5299811d82fa Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Thu, 23 Oct 2014 14:54:07 -0700 Subject: [PATCH 009/732] Fix build. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/659043004 --- engine/src/flutter/tools/debugger/debugger.cc | 4 ++-- engine/src/flutter/tools/tester/tester.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index e4aa111a0a..29bae26af7 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -85,8 +85,8 @@ class SkyDebugger : public mojo::ApplicationDelegate, } virtual void OnViewBoundsChanged(mojo::View* view, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override { + const mojo::Rect& old_bounds, + const mojo::Rect& new_bounds) override { content_->SetBounds(new_bounds); } diff --git a/engine/src/flutter/tools/tester/tester.cc b/engine/src/flutter/tools/tester/tester.cc index 051236a786..fd1f4ff45c 100644 --- a/engine/src/flutter/tools/tester/tester.cc +++ b/engine/src/flutter/tools/tester/tester.cc @@ -77,8 +77,8 @@ class SkyTester : public mojo::ApplicationDelegate, } virtual void OnViewBoundsChanged(mojo::View* view, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override { + const mojo::Rect& old_bounds, + const mojo::Rect& new_bounds) override { content_->SetBounds(new_bounds); } From d79cb9d7348f7e2dcc29d07eb87483b26d27355d Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 14:56:44 -0700 Subject: [PATCH 010/732] Make skydb load examples/home.sky by default. I had to also register for the text/plain mime-type which turned out to be harder than expected. Mostly due to my confusion with mojo_shell using last-argument-wins argument parsing. R=ianh@google.com Review URL: https://codereview.chromium.org/672363002 --- engine/src/flutter/examples/home.sky | 2 ++ engine/src/flutter/tools/debugger/prompt/prompt.cc | 8 ++++++-- engine/src/flutter/tools/skydb | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/examples/home.sky b/engine/src/flutter/examples/home.sky index 3a447fd3db..5cfbaecab4 100644 --- a/engine/src/flutter/examples/home.sky +++ b/engine/src/flutter/examples/home.sky @@ -1,7 +1,9 @@ #!mojo mojo:sky +

about:blank

Welcome to Sky!

+
diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index 3b486045e6..d411c82618 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -45,13 +45,17 @@ class Prompt : public mojo::ApplicationDelegate { app->ConnectToService("mojo:sky_viewer", &tracing_); if (app->args().size() > 1) url_ = app->args()[1]; + else { + url_ = "https://raw.githubusercontent.com/domokit/mojo/master/sky/" + "examples/home.sky"; + } } virtual bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override { connection->ConnectToService(&debugger_); - if (!url_.empty()) - Reload(); + std::cout << "Loading " << url_ << std::endl; + Reload(); ScheduleWaitForInput(); return true; } diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index 406e482609..caa8f8093f 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -13,11 +13,18 @@ CONFIG_DIRECTORY = 'Debug' MOJO_SHELL_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell')) +SUPPORTED_MIME_TYPES = [ + 'text/html', + 'text/plain', +] + def main(args): + content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') + for mime_type in SUPPORTED_MIME_TYPES] shell_command = [ MOJO_SHELL_PATH, '--v=1', - '--content-handlers=text/html,mojo://sky_viewer/', + '--content-handlers=%s' % ','.join(content_handlers), '--url-mappings=mojo:window_manager=mojo:sky_debugger', 'mojo:window_manager', ] From b061da457efb06a1063e4cb5e9734f4e838c7fa9 Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Thu, 23 Oct 2014 15:54:51 -0700 Subject: [PATCH 011/732] Added build instructions --- engine/src/flutter/HACKING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md index 51b99d98a3..b792e1ad8e 100644 --- a/engine/src/flutter/HACKING.md +++ b/engine/src/flutter/HACKING.md @@ -1,6 +1,13 @@ Hacking on Sky ============== +Building +-------- + +* Follow the setup & build instructions for [mojo](https://github.com/domokit/mojo), except... + * run ``gn & ninja`` in ``/sky/`` and use the build target ``sky`` with ``ninja`` rather than ``root`` or ``mojo`` + + Running applications -------------------- From dd992e5f2f52d6eb7edf435370200f2b475b3732 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 16:00:10 -0700 Subject: [PATCH 012/732] Teach tools/skydb how to handle paths This makes it much easier to hack on test cases. R=abarth@chromium.org Review URL: https://codereview.chromium.org/654543004 --- engine/src/flutter/tools/skydb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index caa8f8093f..5b3732fb20 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -6,6 +6,7 @@ import os import subprocess import sys +import urlparse BUILD_DIRECTORY = 'out' @@ -18,6 +19,19 @@ SUPPORTED_MIME_TYPES = [ 'text/plain', ] +def start_http_server_for_file(path): + HTTP_PORT = 9999 + directory = os.path.dirname(os.path.abspath(path)) + server_command = [ + 'python', + '-m', + 'SimpleHTTPServer', + str(HTTP_PORT) + ] + subprocess.Popen(server_command, cwd=directory) + return 'http://localhost:%s/%s' % (HTTP_PORT, os.path.basename(path)) + + def main(args): content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') for mime_type in SUPPORTED_MIME_TYPES] @@ -29,7 +43,12 @@ def main(args): 'mojo:window_manager', ] if args: - prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % args[0] + url = args[0] + parse_result = urlparse.urlparse(url) + if not parse_result.scheme: + url = start_http_server_for_file(url) + + prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % url shell_command.append(prompt_args) subprocess.check_call(shell_command) From b6c1140c8e258bc31dce19cb6b7957d121d1b10b Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Thu, 23 Oct 2014 16:02:04 -0700 Subject: [PATCH 013/732] Fixing the fix --- engine/src/flutter/HACKING.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md index b792e1ad8e..b63654e17b 100644 --- a/engine/src/flutter/HACKING.md +++ b/engine/src/flutter/HACKING.md @@ -4,9 +4,8 @@ Hacking on Sky Building -------- -* Follow the setup & build instructions for [mojo](https://github.com/domokit/mojo), except... - * run ``gn & ninja`` in ``/sky/`` and use the build target ``sky`` with ``ninja`` rather than ``root`` or ``mojo`` - +* Follow the setup & build instructions for [mojo](https://github.com/domokit/mojo) +* Build ``sky`` with ``ninja``, e.g. ``ninja C out/Debug sky`` Running applications -------------------- From 0c525575cb5d3cf0ab9a9783a935878b8fc52b59 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 16:02:39 -0700 Subject: [PATCH 014/732] Add --gdb argument to skydb Makes it trivial to drop into gdb having launched mojo_shell/sky with the right arguments. R=abarth@chromium.org Review URL: https://codereview.chromium.org/672383002 --- engine/src/flutter/tools/skydb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index 5b3732fb20..83aeb016ff 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -3,6 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import argparse import os import subprocess import sys @@ -32,7 +33,12 @@ def start_http_server_for_file(path): return 'http://localhost:%s/%s' % (HTTP_PORT, os.path.basename(path)) -def main(args): +def main(): + parser = argparse.ArgumentParser(description='Sky launcher/debugger') + parser.add_argument('--gdb', action='store_true') + parser.add_argument('url', nargs='?', type=str) + args = parser.parse_args() + content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') for mime_type in SUPPORTED_MIME_TYPES] shell_command = [ @@ -42,16 +48,19 @@ def main(args): '--url-mappings=mojo:window_manager=mojo:sky_debugger', 'mojo:window_manager', ] - if args: - url = args[0] - parse_result = urlparse.urlparse(url) - if not parse_result.scheme: + if args.url: + url = args.url + if not urlparse.urlparse(url).scheme: url = start_http_server_for_file(url) prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % url shell_command.append(prompt_args) + if args.gdb: + shell_command = ['gdb', '--args'] + shell_command + + print ' '.join(shell_command) subprocess.check_call(shell_command) if __name__ == '__main__': - main(sys.argv[1:]) + main() From ccca233ad597b9e13d5bc3ad0ac515230a49e85b Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Thu, 23 Oct 2014 16:10:08 -0700 Subject: [PATCH 015/732] Update HACKING.md --- engine/src/flutter/HACKING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md index b63654e17b..e53c80d69d 100644 --- a/engine/src/flutter/HACKING.md +++ b/engine/src/flutter/HACKING.md @@ -5,7 +5,7 @@ Building -------- * Follow the setup & build instructions for [mojo](https://github.com/domokit/mojo) -* Build ``sky`` with ``ninja``, e.g. ``ninja C out/Debug sky`` +* Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` Running applications -------------------- From b0ea9ac245080ef511f48ebd311aaf79acaf042e Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 23 Oct 2014 16:54:21 -0700 Subject: [PATCH 016/732] Fix border parsing to work again I accidentally broke border parsing when removing CSS color keyword hacks. While debugging this I also ran into a race condition in the debugger, which is fixed here. Add --gdb argument to skydb Makes it trivial to drop into gdb having launched mojo_shell/sky with the right arguments. R=ojan@chromium.org Review URL: https://codereview.chromium.org/673073002 --- engine/src/flutter/tools/debugger/debugger.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index 29bae26af7..52d00447db 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -70,6 +70,9 @@ class SkyDebugger : public mojo::ApplicationDelegate, window_manager_app_->InitFocus( new FocusRules(window_manager_app_.get(), content_)); + + if (!pending_url_.empty()) + NavigateToURL(pending_url_); } virtual void OnViewManagerDisconnected( @@ -98,7 +101,13 @@ class SkyDebugger : public mojo::ApplicationDelegate, // Overridden from Debugger virtual void NavigateToURL(const mojo::String& url) override { - content_->Embed(url); + // We can get Navigate commands before we've actually been + // embedded into the view and content_ created. + // Just save the last one. + if (content_) + content_->Embed(url); + else + pending_url_ = url; } scoped_ptr window_manager_app_; @@ -106,6 +115,7 @@ class SkyDebugger : public mojo::ApplicationDelegate, mojo::ViewManager* view_manager_; mojo::View* root_; mojo::View* content_; + std::string pending_url_; DISALLOW_COPY_AND_ASSIGN(SkyDebugger); }; From 52e4bc9c93533cf2a7c4ef11e6df5f8debf13018 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Thu, 23 Oct 2014 20:20:25 -0700 Subject: [PATCH 017/732] Get rid of ScrollView. We only allow overflow scrolling. The frame isn't special. This is a first step in making that happen. There's a lot of code to remove after this patch, but this gets rid of ScrollView and a bunch of frame-level scrolling code. Had to add in a FrameWidget class so that Scrollbar.cpp had a way of getting to FrameView::removeChild without pulling a core class into platform. This might go away when we rip out the Widget tree if we made it so that FrameView didn't keep a list of Scrollbar instances. Modified scrollbar.html to use overflow scrolling instead of frame level scrolling. Once we get rid of the split between Document and documentElement, we'll be able to make the root element in the page scrollable as well (i.e. any child of the Document). R=abarth@chromium.org Review URL: https://codereview.chromium.org/646273006 --- .../tests/lowlevel/scrollbar-expected.txt | 8 ++-- .../src/flutter/tests/lowlevel/scrollbar.html | 44 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt b/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt index 2d082379c4..28369d9289 100644 --- a/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt +++ b/engine/src/flutter/tests/lowlevel/scrollbar-expected.txt @@ -1,7 +1,9 @@ -layer at (0,0) size 800x1500 +layer at (0,0) size 800x600 RenderView {#document} at (0,0) size 800x600 -layer at (0,0) size 800x1500 - RenderBlock {html} at (0,0) size 800x1500 [bgcolor=#FFC0CB] +layer at (0,0) size 800x400 + RenderBlock {sky} at (0,0) size 800x400 +layer at (0,0) size 800x400 scrollHeight 1500 + RenderBlock {scroller} at (0,0) size 800x400 RenderBlock {div} at (0,0) size 800x100 RenderText {#text} at (0,0) size 10x19 text run at (0,0) width 10: "a" diff --git a/engine/src/flutter/tests/lowlevel/scrollbar.html b/engine/src/flutter/tests/lowlevel/scrollbar.html index 3e230d41e7..b4eee6cd03 100644 --- a/engine/src/flutter/tests/lowlevel/scrollbar.html +++ b/engine/src/flutter/tests/lowlevel/scrollbar.html @@ -1,21 +1,23 @@ - - - -
a
-
b
-
c
-
d
-
e
-
f
-
g
-
h
-
i
-
j
-
k
-
l
-
m
-
n
-
o
- + + + + +
a
+
b
+
c
+
d
+
e
+
f
+
g
+
h
+
i
+
j
+
k
+
l
+
m
+
n
+
o
+
+
From a6d358ef475d3e1267239eb453d262219e73940f Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Oct 2014 20:32:07 -0700 Subject: [PATCH 018/732] Fill in some missing sections in the Sky README.md R=ojan@chromium.org Review URL: https://codereview.chromium.org/679583002 --- engine/src/flutter/HACKING.md | 23 ++++++++++------------- engine/src/flutter/README.md | 9 ++++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md index e53c80d69d..65f8811007 100644 --- a/engine/src/flutter/HACKING.md +++ b/engine/src/flutter/HACKING.md @@ -4,42 +4,39 @@ Hacking on Sky Building -------- -* Follow the setup & build instructions for [mojo](https://github.com/domokit/mojo) +* Follow the setup & build instructions for [Mojo](https://github.com/domokit/mojo) * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` Running applications -------------------- -* ``./sky/tools/skydb --debug`` +* ``./sky/tools/skydb [url]`` * 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. +* ``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`` +* Import ``resources/mocha.html`` and ``resources/chai.html`` * Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-started) and use [chai asserts](http://chaijs.com/api/assert/): -``` +```html 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/README.md b/engine/src/flutter/README.md index b750fc08dc..a4f2eda824 100644 --- a/engine/src/flutter/README.md +++ b/engine/src/flutter/README.md @@ -143,10 +143,13 @@ encode and decode messages sent over Mojo pipes. Specifications -------------- -TODO: Link to the specs. +We're documenting Sky with a [set of technical specifications](specs) that +define precisely the behavior of the engine. Currently both the implementation +and the specification are in flux, but hopefully they'll converge over time. Contributing ------------ -TODO: Link to HACKING.md, which contains the instructions for hacking on Sky. -TODO: Link to mailing list and IRC channel. +Instructions for building and testing Sky are contained in [HACKING.md]. For +coordination, we use the ``#mojo`` IRC channel on +[Freenode](https://freenode.net/). From 1a25166c33c37929971053e2cfb5290da3acaaee Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 24 Oct 2014 10:15:36 -0700 Subject: [PATCH 019/732] Remove redundant LICENSE This LICENSE file is redundant with the one in the top-level directory. R=ojan@chromium.org Review URL: https://codereview.chromium.org/674013003 --- engine/src/flutter/LICENSE | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 engine/src/flutter/LICENSE diff --git a/engine/src/flutter/LICENSE b/engine/src/flutter/LICENSE deleted file mode 100644 index 70bcb8ad11..0000000000 --- a/engine/src/flutter/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -// 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. From 5a3423ff3ddcf52114868db351c7e6c1f0d3df6d Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 24 Oct 2014 10:16:36 -0700 Subject: [PATCH 020/732] Test for border parsing I failed to include in my last change. https://codereview.chromium.org/673073002/ R=abarth@chromium.org Review URL: https://codereview.chromium.org/654393004 --- .../tests/styles/border-parsing-expected.txt | 5 +++++ .../src/flutter/tests/styles/border-parsing.html | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 engine/src/flutter/tests/styles/border-parsing-expected.txt create mode 100644 engine/src/flutter/tests/styles/border-parsing.html diff --git a/engine/src/flutter/tests/styles/border-parsing-expected.txt b/engine/src/flutter/tests/styles/border-parsing-expected.txt new file mode 100644 index 0000000000..e0a76e3a51 --- /dev/null +++ b/engine/src/flutter/tests/styles/border-parsing-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Border should render +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/styles/border-parsing.html b/engine/src/flutter/tests/styles/border-parsing.html new file mode 100644 index 0000000000..78630b794f --- /dev/null +++ b/engine/src/flutter/tests/styles/border-parsing.html @@ -0,0 +1,14 @@ + + + + + + From e7178210c5e1e34973cfb1c5fd2d456bada2957a Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 24 Oct 2014 11:36:40 -0700 Subject: [PATCH 021/732] Add a script for finding files missing from gn Most of the files listed here can just be removed from the repository. R=abarth@chromium.org Review URL: https://codereview.chromium.org/679783002 --- engine/src/flutter/tools/missing_from_gn | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 engine/src/flutter/tools/missing_from_gn diff --git a/engine/src/flutter/tools/missing_from_gn b/engine/src/flutter/tools/missing_from_gn new file mode 100755 index 0000000000..262e20b085 --- /dev/null +++ b/engine/src/flutter/tools/missing_from_gn @@ -0,0 +1,84 @@ +#!/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 subprocess +import os +import argparse +import logging + +ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, + os.pardir)) + +def dependencies(): + args = [ + 'gn', + 'desc', + os.path.join('out', 'Debug'), + '//sky/engine/public:blink', + 'deps', '--all' + ] + targets = subprocess.check_output(args).splitlines() + return map(str.strip, targets) + + +def sources(target): + print target + args = [ + 'gn', + 'desc', + os.path.join('out', 'Debug'), + target, + 'sources' + ] + sources = subprocess.check_output(args).splitlines() + return map(lambda s: s[2:], map(str.strip, sources)) + + +def find_on_disk(path): + # FIXME: Use os.walk and do fancier ignoring. + find_output = subprocess.check_output(['find', path, '-type', 'f']) + return map(str.strip, find_output.splitlines()) + + +def main(): + logging.basicConfig() + + os.chdir(ROOT_DIR) + if os.path.exists('in_gn.txt'): + logging.info('Using cached GN list: %s' % os.path.abspath('in_gn.txt')) + in_gn = set(map(str.strip, open('in_gn.txt').readlines())) + else: + logging.info('No gn cache found, rebuilding: %s' % os.abspath('in_gn.txt')) + targets = filter(lambda s: '//sky' in s, dependencies()) + in_gn = set(sum(map(sources, targets), [])) + open('in_gn.txt', 'w+').write('\n'.join(in_gn)) + + on_disk = set(find_on_disk('sky/engine')) + # Ignore web/tests and bindings/tests + on_disk = set(filter(lambda p: '/tests/' not in p, on_disk)) + + missing_from_gn = sorted(on_disk - in_gn) + + IGNORED_EXTENSIONS = [ + '.py', # Probably some to remove, probably some to teach gn about. + # Python files not being known to gn can cause flaky builds too! + '.pyc', + '.gypi', + '.gn', + '.gni', + '.h', # Ignore headers for the moment. + ] + for ext in IGNORED_EXTENSIONS: + missing_from_gn = filter(lambda p: not p.endswith(ext), missing_from_gn) + + # All upper-case files like README, DEPS, etc. are fine. + missing_from_gn = filter(lambda p: not os.path.basename(p).isupper(), + missing_from_gn) + + print '\n'.join(missing_from_gn) + + +if __name__ == '__main__': + main() From 87fb3c9d193cc6d6152b0629a903bff83b5f4228 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 24 Oct 2014 13:44:44 -0700 Subject: [PATCH 022/732] Teach missing_from_gn about gn 'inputs' Turns out gn has 3 types of sources: inputs (non-source files) sources (source files) public (source files for APIs) I've now taught missing_from_gn about inputs brettw says I can ignore public for now as it's unlikely anyone is using that. R=brettw@chromium.org Review URL: https://codereview.chromium.org/675283002 --- engine/src/flutter/tools/missing_from_gn | 66 +++++++++++++----------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/engine/src/flutter/tools/missing_from_gn b/engine/src/flutter/tools/missing_from_gn index 262e20b085..d8d6ebe607 100755 --- a/engine/src/flutter/tools/missing_from_gn +++ b/engine/src/flutter/tools/missing_from_gn @@ -11,49 +11,53 @@ import logging ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir)) -def dependencies(): - args = [ - 'gn', - 'desc', - os.path.join('out', 'Debug'), - '//sky/engine/public:blink', - 'deps', '--all' - ] - targets = subprocess.check_output(args).splitlines() - return map(str.strip, targets) +# Where to cache GN results (they're expensive to compute). +GN_CACHE_PATH = os.path.abspath(os.path.join(ROOT_DIR, 'in_gn.txt')) -def sources(target): - print target - args = [ - 'gn', - 'desc', +def stripped_lines_from_command(cmd, cwd=None): + lines = subprocess.check_output(cmd, cwd=cwd).splitlines() + return map(str.strip, lines) + + +def gn_desc(*args): + # GN doesn't understand absolute paths yet, so use a relative BUILD_DIR + # and pass ROOT_DIR as the CWD. + cmd = [ + 'gn', 'desc', + # Hard-coding Debug for now: os.path.join('out', 'Debug'), - target, - 'sources' - ] - sources = subprocess.check_output(args).splitlines() - return map(lambda s: s[2:], map(str.strip, sources)) + ] + list(args) + return stripped_lines_from_command(cmd, cwd=ROOT_DIR) + + +def targets_under(target): + targets = gn_desc(target, 'deps', '--all') + return filter(lambda s: s.startswith(target), targets) + + +def used_files(target): + logging.info(target) + sources = map(lambda s: s[2:], gn_desc(target, 'sources')) + inputs = map(lambda s: s[2:], gn_desc(target, 'inputs')) + return sources + inputs def find_on_disk(path): # FIXME: Use os.walk and do fancier ignoring. - find_output = subprocess.check_output(['find', path, '-type', 'f']) - return map(str.strip, find_output.splitlines()) + return stripped_lines_from_command(['find', path, '-type', 'f']) def main(): - logging.basicConfig() + logging.basicConfig(level=logging.INFO) - os.chdir(ROOT_DIR) - if os.path.exists('in_gn.txt'): - logging.info('Using cached GN list: %s' % os.path.abspath('in_gn.txt')) - in_gn = set(map(str.strip, open('in_gn.txt').readlines())) + if os.path.exists(GN_CACHE_PATH): + logging.info('Using cached GN list: %s' % GN_CACHE_PATH) + in_gn = set(map(str.strip, open(GN_CACHE_PATH).readlines())) else: - logging.info('No gn cache found, rebuilding: %s' % os.abspath('in_gn.txt')) - targets = filter(lambda s: '//sky' in s, dependencies()) - in_gn = set(sum(map(sources, targets), [])) - open('in_gn.txt', 'w+').write('\n'.join(in_gn)) + logging.info('No gn cache found, rebuilding: %s' % GN_CACHE_PATH) + in_gn = set(sum(map(used_files, targets_under('//sky')), [])) + open(GN_CACHE_PATH, 'w+').write('\n'.join(in_gn)) on_disk = set(find_on_disk('sky/engine')) # Ignore web/tests and bindings/tests From 44d30c6fa6b407a42702d851eda36c485dc4ecd2 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 24 Oct 2014 13:50:21 -0700 Subject: [PATCH 023/732] Remove a bunch of dead files found by missing_from_gn I also fixed several errors in our BUILD.gn files including bad script dependencies found by missing_from_gn and gn check. Still need to figure out how best to handle :libraries deps being private to :core, etc. R=abarth@chromium.org Review URL: https://codereview.chromium.org/678703004 --- engine/src/flutter/tools/missing_from_gn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/tools/missing_from_gn b/engine/src/flutter/tools/missing_from_gn index d8d6ebe607..fdc64d07e9 100755 --- a/engine/src/flutter/tools/missing_from_gn +++ b/engine/src/flutter/tools/missing_from_gn @@ -23,11 +23,9 @@ def stripped_lines_from_command(cmd, cwd=None): def gn_desc(*args): # GN doesn't understand absolute paths yet, so use a relative BUILD_DIR # and pass ROOT_DIR as the CWD. - cmd = [ - 'gn', 'desc', - # Hard-coding Debug for now: - os.path.join('out', 'Debug'), - ] + list(args) + # Hard-coding Debug for now: + BUILD_DIR = '//out/Debug' # // means repository root-relative. + cmd = ['gn', 'desc', BUILD_DIR] + list(args) return stripped_lines_from_command(cmd, cwd=ROOT_DIR) @@ -40,7 +38,9 @@ def used_files(target): logging.info(target) sources = map(lambda s: s[2:], gn_desc(target, 'sources')) inputs = map(lambda s: s[2:], gn_desc(target, 'inputs')) - return sources + inputs + public = map(lambda s: s[2:], gn_desc(target, 'public')) + script = map(lambda s: s[2:], gn_desc(target, 'script')) + return sources + inputs + public + script def find_on_disk(path): From 6d1044e8a608826a3330e50a0173d5a5850688c5 Mon Sep 17 00:00:00 2001 From: Hixie Date: Fri, 24 Oct 2014 14:14:34 -0700 Subject: [PATCH 024/732] Docs: fix markdown in various files, update the README mildly Review URL: https://codereview.chromium.org/678693003 --- engine/src/flutter/README.md | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/README.md b/engine/src/flutter/README.md index a4f2eda824..ac26662094 100644 --- a/engine/src/flutter/README.md +++ b/engine/src/flutter/README.md @@ -17,7 +17,7 @@ theme layer that gives each widget a concrete visual and interactive design. Elements -------- -The Sky engine contains a handful of primitive elements and the tools with which +The Sky engine contains [a handful of primitive elements](specs/markup.md) and the tools with which to create custom elements. The following elements are built into the engine: - ``script``: Executes script @@ -27,9 +27,10 @@ to create custom elements. The following elements are built into the engine: - ``template``: Captures descendants for use as a template - ``content``: Visually projects descendents of the shadow host - ``shadow``: Visually projects older shadow roots of the shadow host - - ``image``: Displays an image + - ``img``: Displays an image - ``a``: Links to another Mojo application - ``title``: Briefly describes the current application state to the user + - ``t``: Preserve whitespace (by default, whitespace nodes are dropped) ### Additional Elements ### @@ -64,10 +65,19 @@ For example, the ``AnnualReport`` constructor uses the ``BalanceSheet`` class exported by that module. ```html - - +SKY MODULE + + - [ ... custom element definition ... ] +class extends SkyElement { + constructor () { + this.addEventListener('click', (event) => this.updateTime()); + this.createShadowTree().appendChild('Click to show the time'); + } + updateTime() { + this.shadowTree.firstChild.replaceWith(new Date()); + } +} + From 5dd15fe8d3cc66a8050cab27cd48d81d02174c81 Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 27 Oct 2014 17:35:15 -0700 Subject: [PATCH 030/732] Move the tests from .html to .sky R=abarth@chromium.org Review URL: https://codereview.chromium.org/685623002 --- engine/src/flutter/tests/TestExpectations | 10 +++++----- ...tml => constructor-calls-created-synchronously.sky} | 4 ++-- ...register-basic.html => document-register-basic.sky} | 4 ++-- ...> document-register-reentrant-null-constructor.sky} | 4 ++-- ... => document-register-reentrant-returning-fake.sky} | 4 ++-- ...cument-register-reentrant-throwing-constructor.sky} | 4 ++-- ...k.html => element-upgrade-no-register-and-leak.sky} | 2 +- ...ert.html => html-element-type-extension-assert.sky} | 2 +- ...l => lifecycle-created-createElement-recursion.sky} | 2 +- ... => lifecycle-created-createElement-reentrancy.sky} | 4 ++-- ...script.html => lifecycle-created-parser-script.sky} | 4 ++-- ...t-register-fuzz.html => document-register-fuzz.sky} | 0 .../tests/editing/{backspace.html => backspace.sky} | 0 .../tests/editing/{replace.html => replace.sky} | 0 .../tests/editing/{selection.html => selection.sky} | 0 .../flutter/tests/editing/{typing.html => typing.sky} | 0 engine/src/flutter/tests/http/conf/mime.types | 1 + ...ml => dom-mutation-modify-text-node-and-append.sky} | 2 +- .../inspector/{dom-mutation.html => dom-mutation.sky} | 4 ++-- .../flutter/tests/lowlevel/{abarth.html => abarth.sky} | 2 +- ...ribute-collection.html => attribute-collection.sky} | 4 ++-- .../tests/lowlevel/{camel-case.html => camel-case.sky} | 4 ++-- .../lowlevel/{createElement.html => createElement.sky} | 4 ++-- ...ent.html => dom-implementation-create-document.sky} | 4 ++-- engine/src/flutter/tests/lowlevel/hello-world.html | 4 ---- engine/src/flutter/tests/lowlevel/hello-world.sky | 4 ++++ .../{query-selector.html => query-selector.sky} | 4 ++-- .../tests/lowlevel/{scrollbar.html => scrollbar.sky} | 2 +- .../lowlevel/{style-basic.html => style-basic.sky} | 2 +- .../{style-specificity.html => style-specificity.sky} | 4 ++-- engine/src/flutter/tests/lowlevel/text.html | 6 ------ engine/src/flutter/tests/lowlevel/text.sky | 6 ++++++ .../mocha/{describe-only.html => describe-only.sky} | 4 ++-- .../flutter/tests/mocha/{it-only.html => it-only.sky} | 4 ++-- engine/src/flutter/tests/modules/basic-expected.txt | 2 +- engine/src/flutter/tests/modules/basic.html | 8 -------- engine/src/flutter/tests/modules/basic.sky | 8 ++++++++ .../tests/modules/imports-can-import-expected.txt | 2 +- ...{imports-can-import.html => imports-can-import.sky} | 2 +- .../flutter/tests/modules/resources/intermediate.html | 7 ------- .../flutter/tests/modules/resources/intermediate.sky | 7 +++++++ engine/src/flutter/tests/modules/resources/pass.html | 3 --- engine/src/flutter/tests/modules/resources/pass.sky | 3 +++ ...{callback-arguments.html => callback-arguments.sky} | 4 ++-- ...ivery.html => clear-transient-without-delivery.sky} | 4 ++-- ...during-delivery.html => create-during-delivery.sky} | 4 ++-- .../{cross-document.html => cross-document.sky} | 4 ++-- .../{delivery-order.html => delivery-order.sky} | 4 ++-- ...ncel-pending.html => disconnect-cancel-pending.sky} | 4 ++-- ...-insertion.html => document-fragment-insertion.sky} | 4 ++-- ...during-delivery.html => mutate-during-delivery.sky} | 4 ++-- ...sh.html => mutation-callback-non-element-crash.sky} | 2 +- ...structor.html => mutation-observer-constructor.sky} | 4 ++-- ...onstructor.html => mutation-record-constructor.sky} | 4 ++-- ...record-nullity.html => mutation-record-nullity.sky} | 4 ++-- ...{observe-attributes.html => observe-attributes.sky} | 4 ++-- ...ve-characterdata.html => observe-characterdata.sky} | 4 ++-- .../{observe-childList.html => observe-childList.sky} | 4 ++-- ...{observe-exceptions.html => observe-exceptions.sky} | 4 ++-- ...-attributes.html => observe-options-attributes.sky} | 4 ++-- ...er-data.html => observe-options-character-data.sky} | 4 ++-- .../{observe-subtree.html => observe-subtree.sky} | 4 ++-- ...ent.html => observer-wrapper-dropoff-transient.sky} | 4 ++-- ...apper-dropoff.html => observer-wrapper-dropoff.sky} | 0 .../{script-append.html => script-append.sky} | 4 ++-- .../{shadow-dom.html => shadow-dom.sky} | 4 ++-- .../{takeRecords.html => takeRecords.sky} | 4 ++-- ...{transient-gc-crash.html => transient-gc-crash.sky} | 0 ...llback-gc-crash.html => weak-callback-gc-crash.sky} | 0 .../tests/parser/{comments.html => comments.sky} | 2 +- engine/src/flutter/tests/parser/entity-expected.txt | 2 +- .../flutter/tests/parser/{entity.html => entity.sky} | 2 +- .../flutter/tests/services/{buffer.html => buffer.sky} | 2 +- .../flutter/tests/services/{codec.html => codec.sky} | 2 +- .../src/flutter/tests/services/{core.html => core.sky} | 2 +- .../tests/services/{network.html => network.sky} | 4 ++-- .../styles/{border-parsing.html => border-parsing.sky} | 4 ++-- .../styles/{inline-style.html => inline-style.sky} | 4 ++-- engine/src/flutter/tools/skydb | 1 + 79 files changed, 134 insertions(+), 132 deletions(-) rename engine/src/flutter/tests/custom-elements/{constructor-calls-created-synchronously.html => constructor-calls-created-synchronously.sky} (81%) rename engine/src/flutter/tests/custom-elements/{document-register-basic.html => document-register-basic.sky} (97%) rename engine/src/flutter/tests/custom-elements/{document-register-reentrant-null-constructor.html => document-register-reentrant-null-constructor.sky} (72%) rename engine/src/flutter/tests/custom-elements/{document-register-reentrant-returning-fake.html => document-register-reentrant-returning-fake.sky} (78%) rename engine/src/flutter/tests/custom-elements/{document-register-reentrant-throwing-constructor.html => document-register-reentrant-throwing-constructor.sky} (75%) rename engine/src/flutter/tests/custom-elements/{element-upgrade-no-register-and-leak.html => element-upgrade-no-register-and-leak.sky} (85%) rename engine/src/flutter/tests/custom-elements/{html-element-type-extension-assert.html => html-element-type-extension-assert.sky} (81%) rename engine/src/flutter/tests/custom-elements/{lifecycle-created-createElement-recursion.html => lifecycle-created-createElement-recursion.sky} (83%) rename engine/src/flutter/tests/custom-elements/{lifecycle-created-createElement-reentrancy.html => lifecycle-created-createElement-reentrancy.sky} (89%) rename engine/src/flutter/tests/custom-elements/{lifecycle-created-parser-script.html => lifecycle-created-parser-script.sky} (78%) rename engine/src/flutter/tests/custom-elements/resources/{document-register-fuzz.html => document-register-fuzz.sky} (100%) rename engine/src/flutter/tests/editing/{backspace.html => backspace.sky} (100%) rename engine/src/flutter/tests/editing/{replace.html => replace.sky} (100%) rename engine/src/flutter/tests/editing/{selection.html => selection.sky} (100%) rename engine/src/flutter/tests/editing/{typing.html => typing.sky} (100%) rename engine/src/flutter/tests/inspector/{dom-mutation-modify-text-node-and-append.html => dom-mutation-modify-text-node-and-append.sky} (92%) rename engine/src/flutter/tests/inspector/{dom-mutation.html => dom-mutation.sky} (87%) rename engine/src/flutter/tests/lowlevel/{abarth.html => abarth.sky} (95%) rename engine/src/flutter/tests/lowlevel/{attribute-collection.html => attribute-collection.sky} (94%) rename engine/src/flutter/tests/lowlevel/{camel-case.html => camel-case.sky} (74%) rename engine/src/flutter/tests/lowlevel/{createElement.html => createElement.sky} (97%) rename engine/src/flutter/tests/lowlevel/{dom-implementation-create-document.html => dom-implementation-create-document.sky} (79%) delete mode 100644 engine/src/flutter/tests/lowlevel/hello-world.html create mode 100644 engine/src/flutter/tests/lowlevel/hello-world.sky rename engine/src/flutter/tests/lowlevel/{query-selector.html => query-selector.sky} (95%) rename engine/src/flutter/tests/lowlevel/{scrollbar.html => scrollbar.sky} (97%) rename engine/src/flutter/tests/lowlevel/{style-basic.html => style-basic.sky} (95%) rename engine/src/flutter/tests/lowlevel/{style-specificity.html => style-specificity.sky} (80%) delete mode 100644 engine/src/flutter/tests/lowlevel/text.html create mode 100644 engine/src/flutter/tests/lowlevel/text.sky rename engine/src/flutter/tests/mocha/{describe-only.html => describe-only.sky} (71%) rename engine/src/flutter/tests/mocha/{it-only.html => it-only.sky} (68%) delete mode 100644 engine/src/flutter/tests/modules/basic.html create mode 100644 engine/src/flutter/tests/modules/basic.sky rename engine/src/flutter/tests/modules/{imports-can-import.html => imports-can-import.sky} (65%) delete mode 100644 engine/src/flutter/tests/modules/resources/intermediate.html create mode 100644 engine/src/flutter/tests/modules/resources/intermediate.sky delete mode 100644 engine/src/flutter/tests/modules/resources/pass.html create mode 100644 engine/src/flutter/tests/modules/resources/pass.sky rename engine/src/flutter/tests/mutation-observer/{callback-arguments.html => callback-arguments.sky} (83%) rename engine/src/flutter/tests/mutation-observer/{clear-transient-without-delivery.html => clear-transient-without-delivery.sky} (89%) rename engine/src/flutter/tests/mutation-observer/{create-during-delivery.html => create-during-delivery.sky} (90%) rename engine/src/flutter/tests/mutation-observer/{cross-document.html => cross-document.sky} (94%) rename engine/src/flutter/tests/mutation-observer/{delivery-order.html => delivery-order.sky} (92%) rename engine/src/flutter/tests/mutation-observer/{disconnect-cancel-pending.html => disconnect-cancel-pending.sky} (91%) rename engine/src/flutter/tests/mutation-observer/{document-fragment-insertion.html => document-fragment-insertion.sky} (95%) rename engine/src/flutter/tests/mutation-observer/{mutate-during-delivery.html => mutate-during-delivery.sky} (89%) rename engine/src/flutter/tests/mutation-observer/{mutation-callback-non-element-crash.html => mutation-callback-non-element-crash.sky} (86%) rename engine/src/flutter/tests/mutation-observer/{mutation-observer-constructor.html => mutation-observer-constructor.sky} (88%) rename engine/src/flutter/tests/mutation-observer/{mutation-record-constructor.html => mutation-record-constructor.sky} (84%) rename engine/src/flutter/tests/mutation-observer/{mutation-record-nullity.html => mutation-record-nullity.sky} (93%) rename engine/src/flutter/tests/mutation-observer/{observe-attributes.html => observe-attributes.sky} (99%) rename engine/src/flutter/tests/mutation-observer/{observe-characterdata.html => observe-characterdata.sky} (98%) rename engine/src/flutter/tests/mutation-observer/{observe-childList.html => observe-childList.sky} (98%) rename engine/src/flutter/tests/mutation-observer/{observe-exceptions.html => observe-exceptions.sky} (93%) rename engine/src/flutter/tests/mutation-observer/{observe-options-attributes.html => observe-options-attributes.sky} (90%) rename engine/src/flutter/tests/mutation-observer/{observe-options-character-data.html => observe-options-character-data.sky} (87%) rename engine/src/flutter/tests/mutation-observer/{observe-subtree.html => observe-subtree.sky} (98%) rename engine/src/flutter/tests/mutation-observer/{observer-wrapper-dropoff-transient.html => observer-wrapper-dropoff-transient.sky} (89%) rename engine/src/flutter/tests/mutation-observer/{observer-wrapper-dropoff.html => observer-wrapper-dropoff.sky} (100%) rename engine/src/flutter/tests/mutation-observer/{script-append.html => script-append.sky} (88%) rename engine/src/flutter/tests/mutation-observer/{shadow-dom.html => shadow-dom.sky} (93%) rename engine/src/flutter/tests/mutation-observer/{takeRecords.html => takeRecords.sky} (93%) rename engine/src/flutter/tests/mutation-observer/{transient-gc-crash.html => transient-gc-crash.sky} (100%) rename engine/src/flutter/tests/mutation-observer/{weak-callback-gc-crash.html => weak-callback-gc-crash.sky} (100%) rename engine/src/flutter/tests/parser/{comments.html => comments.sky} (54%) rename engine/src/flutter/tests/parser/{entity.html => entity.sky} (81%) rename engine/src/flutter/tests/services/{buffer.html => buffer.sky} (80%) rename engine/src/flutter/tests/services/{codec.html => codec.sky} (81%) rename engine/src/flutter/tests/services/{core.html => core.sky} (80%) rename engine/src/flutter/tests/services/{network.html => network.sky} (94%) rename engine/src/flutter/tests/styles/{border-parsing.html => border-parsing.sky} (73%) rename engine/src/flutter/tests/styles/{inline-style.html => inline-style.sky} (80%) diff --git a/engine/src/flutter/tests/TestExpectations b/engine/src/flutter/tests/TestExpectations index 0547a15665..a19c7b0814 100644 --- a/engine/src/flutter/tests/TestExpectations +++ b/engine/src/flutter/tests/TestExpectations @@ -3,12 +3,12 @@ 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 ] +crbug.com/1 mutation-observer/observer-wrapper-dropoff-transient.sky [ Skip ] +crbug.com/1 mutation-observer/observer-wrapper-dropoff.sky [ Skip ] +crbug.com/1 mutation-observer/transient-gc-crash.sky [ Skip ] +crbug.com/1 mutation-observer/weak-callback-gc-crash.sky [ Skip ] # We need to land the new inspector backend Bug(abarth) inspector [ Skip ] -Bug(abarth) services/network.html [ Crash ] +Bug(abarth) services/network.sky [ Crash ] 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.sky similarity index 81% rename from engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html rename to engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.sky index 067ada4143..5c4cd1ac39 100644 --- a/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.html +++ b/engine/src/flutter/tests/custom-elements/constructor-calls-created-synchronously.sky @@ -1,6 +1,6 @@ - - + +
- diff --git a/engine/src/flutter/tests/modules/basic.sky b/engine/src/flutter/tests/modules/basic.sky new file mode 100644 index 0000000000..17d6b6f0a2 --- /dev/null +++ b/engine/src/flutter/tests/modules/basic.sky @@ -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 index 6bb0ab560e..e214eaa94c 100644 --- a/engine/src/flutter/tests/modules/imports-can-import-expected.txt +++ b/engine/src/flutter/tests/modules/imports-can-import-expected.txt @@ -1 +1 @@ -{"message":"PASS: pass.html succesfully exported this string."} +{"message":"PASS: pass.sky 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.sky similarity index 65% rename from engine/src/flutter/tests/modules/imports-can-import.html rename to engine/src/flutter/tests/modules/imports-can-import.sky index 7983f78e0d..ff84857515 100644 --- a/engine/src/flutter/tests/modules/imports-can-import.html +++ b/engine/src/flutter/tests/modules/imports-can-import.sky @@ -1,5 +1,5 @@ - +
FAIL
diff --git a/engine/src/flutter/tests/modules/resources/intermediate.sky b/engine/src/flutter/tests/modules/resources/intermediate.sky new file mode 100644 index 0000000000..57fc7f5731 --- /dev/null +++ b/engine/src/flutter/tests/modules/resources/intermediate.sky @@ -0,0 +1,7 @@ + + + diff --git a/engine/src/flutter/tests/modules/resources/pass.html b/engine/src/flutter/tests/modules/resources/pass.html deleted file mode 100644 index 75631167c9..0000000000 --- a/engine/src/flutter/tests/modules/resources/pass.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/engine/src/flutter/tests/modules/resources/pass.sky b/engine/src/flutter/tests/modules/resources/pass.sky new file mode 100644 index 0000000000..c98a6a9dda --- /dev/null +++ b/engine/src/flutter/tests/modules/resources/pass.sky @@ -0,0 +1,3 @@ + diff --git a/engine/src/flutter/tests/mutation-observer/callback-arguments.html b/engine/src/flutter/tests/mutation-observer/callback-arguments.sky similarity index 83% rename from engine/src/flutter/tests/mutation-observer/callback-arguments.html rename to engine/src/flutter/tests/mutation-observer/callback-arguments.sky index fefda766d1..3fbdda491b 100644 --- a/engine/src/flutter/tests/mutation-observer/callback-arguments.html +++ b/engine/src/flutter/tests/mutation-observer/callback-arguments.sky @@ -1,6 +1,6 @@ - - + + - From 28626cf782e8b80f958a73f683ff0e306266673b Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 28 Oct 2014 13:18:17 -0700 Subject: [PATCH 037/732] Fix the inspector and integrate it with skydb R=abarth@chromium.org Review URL: https://codereview.chromium.org/690433002 --- engine/src/flutter/tools/sky_server | 31 +++++++++++++++++++++-------- engine/src/flutter/tools/skydb | 5 ++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index c826d56736..ae38fccc57 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -7,10 +7,14 @@ import argparse import os import cherrypy + BUILD_DIRECTORY = 'out' CONFIG_DIRECTORY = 'Debug' -GEN_DIRECTORY = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, - os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen')) +SRC_ROOT = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, + os.pardir)) +SKY_ROOT = os.path.join(SRC_ROOT, 'sky') +GEN_ROOT = os.path.join(SRC_ROOT, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen') + # FIXME: This doesn't yet support directory listings. We'll do something like: # http://tools.cherrypy.org/wiki/staticdirindex @@ -30,14 +34,25 @@ def main(): 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.abspath(args.app_path), }, - '/sky': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'sky'), - }, '/mojo': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'mojo'), - } + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo'), + }, + '/sky': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky'), + }, + # src-relative to avoid needing to rebuild when changing inspector: + '/sky/framework': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': + os.path.join(SKY_ROOT, 'framework'), + }, + '/sky/framework/inspector/server': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky', 'framework', + 'inspector', 'server'), + }, } cherrypy.quickstart(config=config) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index cfe1996ce6..de74aadbb0 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -58,7 +58,10 @@ def main(): if args.gdb: shell_command = ['gdb', '--args'] + shell_command - print ' '.join(shell_command) + print "To inspect, include:" + print '' + print "And open:" + print "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898" subprocess.check_call(shell_command) From 4c5a9b1775f5a4183f359e2d36805f481a9604c5 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 28 Oct 2014 14:13:31 -0700 Subject: [PATCH 038/732] Don't crash when importing a module that doesn't export Instead of crashing, we should use the value "undefined". There's some question as to whether we should default to the document, but we can resolve that later. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/690483002 --- .../tests/modules/import-without-export-expected.txt | 1 + .../src/flutter/tests/modules/import-without-export.sky | 9 +++++++++ .../flutter/tests/modules/resources/does-not-export.sky | 1 + 3 files changed, 11 insertions(+) create mode 100644 engine/src/flutter/tests/modules/import-without-export-expected.txt create mode 100644 engine/src/flutter/tests/modules/import-without-export.sky create mode 100644 engine/src/flutter/tests/modules/resources/does-not-export.sky diff --git a/engine/src/flutter/tests/modules/import-without-export-expected.txt b/engine/src/flutter/tests/modules/import-without-export-expected.txt new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/engine/src/flutter/tests/modules/import-without-export-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/engine/src/flutter/tests/modules/import-without-export.sky b/engine/src/flutter/tests/modules/import-without-export.sky new file mode 100644 index 0000000000..46c94bc6cc --- /dev/null +++ b/engine/src/flutter/tests/modules/import-without-export.sky @@ -0,0 +1,9 @@ + + + +
FAIL - Script did not execute
+ + diff --git a/engine/src/flutter/tests/modules/resources/does-not-export.sky b/engine/src/flutter/tests/modules/resources/does-not-export.sky new file mode 100644 index 0000000000..c570f76902 --- /dev/null +++ b/engine/src/flutter/tests/modules/resources/does-not-export.sky @@ -0,0 +1 @@ +This module has no exports. From 0335886abf3c41a59f52e904c402f0589fbcab57 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 28 Oct 2014 15:38:23 -0700 Subject: [PATCH 039/732] Move framework/inspector/server to services/inspector Moving the inspector WebSocket proxy server out of the framework directory simplifies the mappings for the HTTP servers. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/687673004 --- engine/src/flutter/BUILD.gn | 2 +- engine/src/flutter/tools/sky_server | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index ae6ebfd0c4..ee665ca6e7 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -13,7 +13,7 @@ group("sky") { "//sky/engine/platform:platform_unittests", "//sky/engine/web:sky_unittests", "//sky/engine/wtf:unittests", - "//sky/framework/inspector", + "//sky/services/inspector", "//sky/viewer", ] if (use_aura) { diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index ae38fccc57..1d875e1513 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -42,17 +42,11 @@ def main(): 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky'), }, - # src-relative to avoid needing to rebuild when changing inspector: '/sky/framework': { 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.join(SKY_ROOT, 'framework'), }, - '/sky/framework/inspector/server': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky', 'framework', - 'inspector', 'server'), - }, } cherrypy.quickstart(config=config) From c56ab4979969e7c389ba4e3683d6e9f7e549673c Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 28 Oct 2014 17:08:25 -0700 Subject: [PATCH 040/732] Add inspect command to skydb This CL adds an "inspect" command to skydb that injects the inspector module into the page and prints some instructions for opening the inspector. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/690433004 --- engine/src/flutter/tools/debugger/debugger.cc | 20 ++++++++++++++---- .../src/flutter/tools/debugger/debugger.mojom | 1 + .../flutter/tools/debugger/prompt/prompt.cc | 21 +++++++++++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index 52d00447db..e9a77a2f5c 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -16,6 +16,7 @@ #include "mojo/services/window_manager/window_manager_delegate.h" #include "sky/tools/debugger/focus_rules.h" #include "sky/tools/debugger/debugger.mojom.h" +#include "sky/viewer/services/inspector.mojom.h" namespace sky { @@ -58,7 +59,7 @@ class SkyDebugger : public mojo::ApplicationDelegate, mojo::ViewManager* view_manager, mojo::View* root, mojo::ServiceProviderImpl* exported_services, - scoped_ptr remote_service_provider) override { + scoped_ptr imported_services) override { view_manager_ = view_manager; root_ = root; @@ -104,10 +105,19 @@ class SkyDebugger : public mojo::ApplicationDelegate, // We can get Navigate commands before we've actually been // embedded into the view and content_ created. // Just save the last one. - if (content_) - content_->Embed(url); - else + if (content_) { + scoped_ptr exported_services( + new mojo::ServiceProviderImpl()); + viewer_services_ = content_->Embed(url, exported_services.Pass()); + } else { pending_url_ = url; + } + } + + virtual void InjectInspector() override { + InspectorServicePtr inspector_service; + mojo::ConnectToService(viewer_services_.get(), &inspector_service); + inspector_service->Inject(); } scoped_ptr window_manager_app_; @@ -117,6 +127,8 @@ class SkyDebugger : public mojo::ApplicationDelegate, mojo::View* content_; std::string pending_url_; + scoped_ptr viewer_services_; + DISALLOW_COPY_AND_ASSIGN(SkyDebugger); }; diff --git a/engine/src/flutter/tools/debugger/debugger.mojom b/engine/src/flutter/tools/debugger/debugger.mojom index 067a160569..df3399e27c 100644 --- a/engine/src/flutter/tools/debugger/debugger.mojom +++ b/engine/src/flutter/tools/debugger/debugger.mojom @@ -6,6 +6,7 @@ module sky { interface Debugger { NavigateToURL(string url); + InjectInspector(); }; } diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index d411c82618..6bcc464b34 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -73,6 +73,10 @@ class Prompt : public mojo::ApplicationDelegate { Reload(); return true; } + if (command == "inspect") { + Inspect(); + return true; + } if (command.size() == 1) { char c = command[0]; if (c == 'h') @@ -111,16 +115,25 @@ class Prompt : public mojo::ApplicationDelegate { << "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; + << "Commands: help -- Help" << std::endl + << " trace -- Capture a trace" << std::endl + << " reload -- Reload the current page" << std::endl + << " inspect -- Inspect the current page" << std::endl + << " q -- Quit" << std::endl; } void Reload() { debugger_->NavigateToURL(url_); } + void Inspect() { + debugger_->InjectInspector(); + std::cout + << "Open the following URL in Chrome:" << std::endl + << "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898" + << std::endl; + } + void Quit() { std::cout << "quitting" << std::endl; exit(0); From 4305216cf9a6e047489632bbfa392071ea54b0ae Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 28 Oct 2014 18:58:18 -0700 Subject: [PATCH 041/732] This CL provides a bunch of new parser tests, and updates the TestExpectations file to skip the ones that fail or crash. It also updates the TestExpectations parser to support URLs pointing to the mojo repo's issue tracker. R=abarth@chromium.org Review URL: https://codereview.chromium.org/685593006 --- engine/src/flutter/tests/TestExpectations | 11 ++ engine/src/flutter/tests/parser/README.md | 133 ++++++++++++++++++ .../flutter/tests/parser/control-expected.txt | 8 ++ engine/src/flutter/tests/parser/control.sky | 7 + .../src/flutter/tests/parser/cr-expected.txt | 0 engine/src/flutter/tests/parser/cr.sky | 1 + .../flutter/tests/parser/empty-expected.txt | 0 engine/src/flutter/tests/parser/empty.sky | 0 .../flutter/tests/parser/endtag-expected.txt | 11 ++ engine/src/flutter/tests/parser/endtag.sky | 10 ++ .../flutter/tests/parser/html-expected.txt | 22 +++ engine/src/flutter/tests/parser/html.sky | 23 +++ .../tests/parser/normaliser-crlf-expected.txt | 25 ++++ .../flutter/tests/parser/normaliser-crlf.sky | 19 +++ .../tests/parser/normaliser-null-expected.txt | 12 ++ .../flutter/tests/parser/normaliser-null.sky | Bin 0 -> 189 bytes .../flutter/tests/parser/script-expected.txt | 57 ++++++++ engine/src/flutter/tests/parser/script.sky | 44 ++++++ .../tests/parser/starttag-expected.txt | 28 ++++ engine/src/flutter/tests/parser/starttag.sky | 77 ++++++++++ .../flutter/tests/parser/style-expected.txt | 55 ++++++++ engine/src/flutter/tests/parser/style.sky | 56 ++++++++ .../flutter/tests/parser/utf16-expected.txt | 0 engine/src/flutter/tests/parser/utf16.sky | Bin 0 -> 248 bytes .../flutter/tests/parser/voidtag-expected.txt | 23 +++ engine/src/flutter/tests/parser/voidtag.sky | 22 +++ 26 files changed, 644 insertions(+) create mode 100644 engine/src/flutter/tests/parser/README.md create mode 100644 engine/src/flutter/tests/parser/control-expected.txt create mode 100644 engine/src/flutter/tests/parser/control.sky create mode 100644 engine/src/flutter/tests/parser/cr-expected.txt create mode 100644 engine/src/flutter/tests/parser/cr.sky create mode 100644 engine/src/flutter/tests/parser/empty-expected.txt create mode 100644 engine/src/flutter/tests/parser/empty.sky create mode 100644 engine/src/flutter/tests/parser/endtag-expected.txt create mode 100644 engine/src/flutter/tests/parser/endtag.sky create mode 100644 engine/src/flutter/tests/parser/html-expected.txt create mode 100644 engine/src/flutter/tests/parser/html.sky create mode 100644 engine/src/flutter/tests/parser/normaliser-crlf-expected.txt create mode 100644 engine/src/flutter/tests/parser/normaliser-crlf.sky create mode 100644 engine/src/flutter/tests/parser/normaliser-null-expected.txt create mode 100644 engine/src/flutter/tests/parser/normaliser-null.sky create mode 100644 engine/src/flutter/tests/parser/script-expected.txt create mode 100644 engine/src/flutter/tests/parser/script.sky create mode 100644 engine/src/flutter/tests/parser/starttag-expected.txt create mode 100644 engine/src/flutter/tests/parser/starttag.sky create mode 100644 engine/src/flutter/tests/parser/style-expected.txt create mode 100644 engine/src/flutter/tests/parser/style.sky create mode 100644 engine/src/flutter/tests/parser/utf16-expected.txt create mode 100644 engine/src/flutter/tests/parser/utf16.sky create mode 100644 engine/src/flutter/tests/parser/voidtag-expected.txt create mode 100644 engine/src/flutter/tests/parser/voidtag.sky diff --git a/engine/src/flutter/tests/TestExpectations b/engine/src/flutter/tests/TestExpectations index b781ec733f..979e9bc803 100644 --- a/engine/src/flutter/tests/TestExpectations +++ b/engine/src/flutter/tests/TestExpectations @@ -7,3 +7,14 @@ crbug.com/1 mutation-observer/observer-wrapper-dropoff-transient.sky [ Skip ] crbug.com/1 mutation-observer/observer-wrapper-dropoff.sky [ Skip ] crbug.com/1 mutation-observer/transient-gc-crash.sky [ Skip ] crbug.com/1 mutation-observer/weak-callback-gc-crash.sky [ Skip ] + +# These tests need more basic testing support plumbed right into the +# platform, which we don't currently have: +https://github.com/domokit/mojo/issues/15 parser/cr.sky [ Skip ] +https://github.com/domokit/mojo/issues/15 parser/empty.sky [ Skip ] +#https://github.com/domokit/mojo/issues/15 parser/utf16.sky [ Skip ] + +# These tests fail +https://github.com/domokit/mojo/issues/14 parser/normaliser-null.sky [ Crash ] +https://github.com/domokit/mojo/issues/14 parser/utf16.sky [ Crash ] +https://github.com/domokit/mojo/issues/16 parser/normaliser-crlf.sky [ Skip ] diff --git a/engine/src/flutter/tests/parser/README.md b/engine/src/flutter/tests/parser/README.md new file mode 100644 index 0000000000..9609a21ce2 --- /dev/null +++ b/engine/src/flutter/tests/parser/README.md @@ -0,0 +1,133 @@ +The empty, cr, and utf16 tests don't import the test framework so they +currently hang until timeout. Really they should just check that +nothing crashes. For now they are disabled. + +We should also test the following (each line is its own test): + +``` +< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +a +& +&# +&#x + + + + +&a +&a; +&; +``` + +We should also test: + +- multiple elements per page +- signature stuff +- diff --git a/engine/src/flutter/tests/parser/control-expected.txt b/engine/src/flutter/tests/parser/control-expected.txt new file mode 100644 index 0000000000..bf614e3e03 --- /dev/null +++ b/engine/src/flutter/tests/parser/control-expected.txt @@ -0,0 +1,8 @@ + + + +THIS TEST SHOULD PASS +(control test for success) + + + diff --git a/engine/src/flutter/tests/parser/control.sky b/engine/src/flutter/tests/parser/control.sky new file mode 100644 index 0000000000..ddcd9cc118 --- /dev/null +++ b/engine/src/flutter/tests/parser/control.sky @@ -0,0 +1,7 @@ + + + +THIS TEST SHOULD PASS +(control test for success) + + diff --git a/engine/src/flutter/tests/parser/cr-expected.txt b/engine/src/flutter/tests/parser/cr-expected.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/engine/src/flutter/tests/parser/cr.sky b/engine/src/flutter/tests/parser/cr.sky new file mode 100644 index 0000000000..45a8ca02bf --- /dev/null +++ b/engine/src/flutter/tests/parser/cr.sky @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/engine/src/flutter/tests/parser/empty-expected.txt b/engine/src/flutter/tests/parser/empty-expected.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/engine/src/flutter/tests/parser/empty.sky b/engine/src/flutter/tests/parser/empty.sky new file mode 100644 index 0000000000..e69de29bb2 diff --git a/engine/src/flutter/tests/parser/endtag-expected.txt b/engine/src/flutter/tests/parser/endtag-expected.txt new file mode 100644 index 0000000000..908013bea6 --- /dev/null +++ b/engine/src/flutter/tests/parser/endtag-expected.txt @@ -0,0 +1,11 @@ + + + + +1 +2 +3 +4;> + + + diff --git a/engine/src/flutter/tests/parser/endtag.sky b/engine/src/flutter/tests/parser/endtag.sky new file mode 100644 index 0000000000..6f0a6f6342 --- /dev/null +++ b/engine/src/flutter/tests/parser/endtag.sky @@ -0,0 +1,10 @@ + + + + +1 +2 +3 +4;> + + diff --git a/engine/src/flutter/tests/parser/html-expected.txt b/engine/src/flutter/tests/parser/html-expected.txt new file mode 100644 index 0000000000..63c2f1cdde --- /dev/null +++ b/engine/src/flutter/tests/parser/html-expected.txt @@ -0,0 +1,22 @@ +<!DOCTYPE HTML> + + + + +A <!DOCTYPE HTMLAGAIN> +B <!BOGUSCOMMENT> +C +E +G <! -- -- > +H +I +J +K
+L +M

+N +O

+P + +
+ diff --git a/engine/src/flutter/tests/parser/html.sky b/engine/src/flutter/tests/parser/html.sky new file mode 100644 index 0000000000..eb16312bf4 --- /dev/null +++ b/engine/src/flutter/tests/parser/html.sky @@ -0,0 +1,23 @@ + + + + + +A +B +C +D --> +E +G +H +I +J +K
+L +M

+N

+O
+P
+ + diff --git a/engine/src/flutter/tests/parser/normaliser-crlf-expected.txt b/engine/src/flutter/tests/parser/normaliser-crlf-expected.txt new file mode 100644 index 0000000000..964136e0e2 --- /dev/null +++ b/engine/src/flutter/tests/parser/normaliser-crlf-expected.txt @@ -0,0 +1,25 @@ + + + +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + diff --git a/engine/src/flutter/tests/parser/normaliser-crlf.sky b/engine/src/flutter/tests/parser/normaliser-crlf.sky new file mode 100644 index 0000000000..b898f2b435 --- /dev/null +++ b/engine/src/flutter/tests/parser/normaliser-crlf.sky @@ -0,0 +1,19 @@ + + + +

+
 +
+
+
+
+ +
+
 +
+

+
+ +
+ + diff --git a/engine/src/flutter/tests/parser/normaliser-null-expected.txt b/engine/src/flutter/tests/parser/normaliser-null-expected.txt new file mode 100644 index 0000000000..18b4d1ea2b --- /dev/null +++ b/engine/src/flutter/tests/parser/normaliser-null-expected.txt @@ -0,0 +1,12 @@ + + + +
�
+
�����
+
��
+
��
+
���
+
���
+ + + diff --git a/engine/src/flutter/tests/parser/normaliser-null.sky b/engine/src/flutter/tests/parser/normaliser-null.sky new file mode 100644 index 0000000000000000000000000000000000000000..6f63b69a61247413cc93d29ee77686ccf1bc085a GIT binary patch literal 189 zcmcD?D9O#SUO)SbTEzm2@u2fRcx8t%&%1^1Z + + + + + + + + + + + + + + + + +< +script +> TEST + + + + + + + + + diff --git a/engine/src/flutter/tests/parser/script.sky b/engine/src/flutter/tests/parser/script.sky new file mode 100644 index 0000000000..7d44eb3ebe --- /dev/null +++ b/engine/src/flutter/tests/parser/script.sky @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + +< +script +> TEST + + + + + + + + diff --git a/engine/src/flutter/tests/parser/starttag-expected.txt b/engine/src/flutter/tests/parser/starttag-expected.txt new file mode 100644 index 0000000000..db3ad5c293 --- /dev/null +++ b/engine/src/flutter/tests/parser/starttag-expected.txt @@ -0,0 +1,28 @@ + + + + + 1 + +2 +3 +4 +5 +6 +7 + +< a>8</ a> +<.a>9 +<_a>a +<-a>b +<!a>c</!a> +<%a>d</%a> + + + + + + + + + diff --git a/engine/src/flutter/tests/parser/starttag.sky b/engine/src/flutter/tests/parser/starttag.sky new file mode 100644 index 0000000000..fc56f31436 --- /dev/null +++ b/engine/src/flutter/tests/parser/starttag.sky @@ -0,0 +1,77 @@ + + + + + 1 + +2 +3 +4 +5 +6 +7 + +< a>8 +<.a>9 +<_a>a +<-a>b +c +<%a>d + + + + + + + + diff --git a/engine/src/flutter/tests/parser/style-expected.txt b/engine/src/flutter/tests/parser/style-expected.txt new file mode 100644 index 0000000000..2c4eb18f13 --- /dev/null +++ b/engine/src/flutter/tests/parser/style-expected.txt @@ -0,0 +1,55 @@ + + + + + + + + + +& TEST + + + +& TEST + +& TEST + + + + +< +style +> & TEST + +& TEST + + + + + + + +& TEST + + + diff --git a/engine/src/flutter/tests/parser/style.sky b/engine/src/flutter/tests/parser/style.sky new file mode 100644 index 0000000000..c3bec9f15f --- /dev/null +++ b/engine/src/flutter/tests/parser/style.sky @@ -0,0 +1,56 @@ + + + + + + + + + +& TEST + + + +& TEST + +& TEST + + + + +< +style +> & TEST + +& TEST + + + + + + + +& TEST + + diff --git a/engine/src/flutter/tests/parser/utf16-expected.txt b/engine/src/flutter/tests/parser/utf16-expected.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/engine/src/flutter/tests/parser/utf16.sky b/engine/src/flutter/tests/parser/utf16.sky new file mode 100644 index 0000000000000000000000000000000000000000..63c8c19814238134fe48a6d439ef124682c93452 GIT binary patch literal 248 zcmX@S@9=&G8-@&q5{6uc90ofs1{;PPhD?S$hHM4}h9ZVkh8zZ41|^0}hFpdMhJ1!1 zh7txP1_g!;uv{8gPLDy4K_AR7X2@qKWhi1uW=LfyX3%FyVJHRb(`86xC}z-Q$Yn@m zC}PNFC}k*M(1TkFGEX03brM59LkdGBh!et)!H~&N%%H$f%#Z;#H-{mGL4hHOA(cUa sp#W@BF+(a?3}m_jLnuQCgByb`g9U>g$Q$|$NT%5^=)>)^<6__f0QUnc;Q#;t literal 0 HcmV?d00001 diff --git a/engine/src/flutter/tests/parser/voidtag-expected.txt b/engine/src/flutter/tests/parser/voidtag-expected.txt new file mode 100644 index 0000000000..14aa6a5171 --- /dev/null +++ b/engine/src/flutter/tests/parser/voidtag-expected.txt @@ -0,0 +1,23 @@ + + + + +

a +

a +

a +

a +

a

+

a

+

a

+

a +

a +

a +

a +

a +

a

+

a +

a

+

a + + + diff --git a/engine/src/flutter/tests/parser/voidtag.sky b/engine/src/flutter/tests/parser/voidtag.sky new file mode 100644 index 0000000000..54d6c11250 --- /dev/null +++ b/engine/src/flutter/tests/parser/voidtag.sky @@ -0,0 +1,22 @@ + + + + +

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+

a

+ + From c7fa9658d6164136a90267c9004ed53710b975e5 Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Tue, 28 Oct 2014 19:36:12 -0700 Subject: [PATCH 042/732] Mark hixie's tests as Skip so they don't spam the console. R=abarth@chromium.org Review URL: https://codereview.chromium.org/687893003 --- engine/src/flutter/tests/TestExpectations | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/tests/TestExpectations b/engine/src/flutter/tests/TestExpectations index 979e9bc803..d0bde58777 100644 --- a/engine/src/flutter/tests/TestExpectations +++ b/engine/src/flutter/tests/TestExpectations @@ -15,6 +15,6 @@ https://github.com/domokit/mojo/issues/15 parser/empty.sky [ Skip ] #https://github.com/domokit/mojo/issues/15 parser/utf16.sky [ Skip ] # These tests fail -https://github.com/domokit/mojo/issues/14 parser/normaliser-null.sky [ Crash ] -https://github.com/domokit/mojo/issues/14 parser/utf16.sky [ Crash ] +https://github.com/domokit/mojo/issues/14 parser/normaliser-null.sky [ Skip ] +https://github.com/domokit/mojo/issues/14 parser/utf16.sky [ Skip ] https://github.com/domokit/mojo/issues/16 parser/normaliser-crlf.sky [ Skip ] From 535672268c1f43157d7dc2f18d78d80d140e79fb Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 29 Oct 2014 11:03:54 -0700 Subject: [PATCH 043/732] Don't show sky_server logs to the skydb console R=abarth@chromium.org Review URL: https://codereview.chromium.org/692593004 --- engine/src/flutter/tools/sky_server | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index 1d875e1513..5308b2de9e 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -22,13 +22,23 @@ GEN_ROOT = os.path.join(SRC_ROOT, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen') def main(): parser = argparse.ArgumentParser(description='Sky development server') + parser.add_argument('-v', '--verbose', action='store_true', + help='Enable logging to the console.') parser.add_argument('app_path', type=str) parser.add_argument('port', type=int) args = parser.parse_args() + log_dir = os.path.abspath(os.getcwd()) + print "%s logging to access_log.txt in %s" % ( + parser.prog, log_dir) + config = { 'global': { 'server.socket_port': args.port, + 'log.screen': args.verbose, + 'log.access_log': os.path.join(log_dir, 'access_log.txt'), + # This causes some strange python exception?? + # 'log.error_log': os.path.join(log_dir, 'error_log.txt'), }, '/': { 'tools.staticdir.on': True, From 3d85f637178bbfcc2d6b690f24d392beee2cb2c4 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 29 Oct 2014 12:15:34 -0700 Subject: [PATCH 044/732] Slight simplification to prompt code R=abarth@chromium.org Review URL: https://codereview.chromium.org/678833004 --- .../flutter/tools/debugger/prompt/prompt.cc | 20 ++++++++----------- engine/src/flutter/tools/skydb | 4 ---- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index 6bcc464b34..b8007a7827 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/tools/debugger/prompt/prompt.cc @@ -61,7 +61,7 @@ class Prompt : public mojo::ApplicationDelegate { } bool ExecuteCommand(const std::string& command) { - if (command == "help") { + if (command == "help" || command == "h") { PrintHelp(); return true; } @@ -69,7 +69,7 @@ class Prompt : public mojo::ApplicationDelegate { ToggleTracing(); return true; } - if (command == "reload") { + if (command == "reload" || command == "r") { Reload(); return true; } @@ -77,16 +77,12 @@ class Prompt : public mojo::ApplicationDelegate { Inspect(); return true; } + if (command == "quit" || command == "q") { + Quit(); + 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; + std::cout << "Unknown command: " << command << std::endl; return true; } return false; @@ -119,7 +115,7 @@ class Prompt : public mojo::ApplicationDelegate { << " trace -- Capture a trace" << std::endl << " reload -- Reload the current page" << std::endl << " inspect -- Inspect the current page" << std::endl - << " q -- Quit" << std::endl; + << " quit -- Quit" << std::endl; } void Reload() { diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index de74aadbb0..a66cc0e21d 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -58,10 +58,6 @@ def main(): if args.gdb: shell_command = ['gdb', '--args'] + shell_command - print "To inspect, include:" - print '' - print "And open:" - print "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898" subprocess.check_call(shell_command) From f1aae9495ae71eed58b296690df1c965fb18fa9f Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 29 Oct 2014 12:48:16 -0700 Subject: [PATCH 045/732] Add a basic XMLHttpRequest implementation R=esprehn@chromium.org Review URL: https://codereview.chromium.org/690803002 --- .../flutter/tests/services/xhr-expected.txt | 5 ++++ engine/src/flutter/tests/services/xhr.sky | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 engine/src/flutter/tests/services/xhr-expected.txt create mode 100644 engine/src/flutter/tests/services/xhr.sky diff --git a/engine/src/flutter/tests/services/xhr-expected.txt b/engine/src/flutter/tests/services/xhr-expected.txt new file mode 100644 index 0000000000..7c62dab771 --- /dev/null +++ b/engine/src/flutter/tests/services/xhr-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 XMLHttpRequest should be able to fetch text files +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/services/xhr.sky b/engine/src/flutter/tests/services/xhr.sky new file mode 100644 index 0000000000..5a3f3d2f93 --- /dev/null +++ b/engine/src/flutter/tests/services/xhr.sky @@ -0,0 +1,25 @@ + + + + + + From 3c9e2c9dd24cdeafa458c02e18a37c8fa0905629 Mon Sep 17 00:00:00 2001 From: Hixie Date: Wed, 29 Oct 2014 13:10:33 -0700 Subject: [PATCH 046/732] Docs: Update radio.sky to use the specced API for shadow roots Review URL: https://codereview.chromium.org/692563003 --- engine/src/flutter/examples/radio.sky | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index 5920e50e97..a253af3121 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -14,7 +14,7 @@ SKY MODULE - radio button and radio button group module.exports.RadioElement = sky.registerElement('radio', class extends Element { constructor () { this.addEventListener('click', (event) => this.checked = true); - this.createShadowTree().appendChild(module.document.findId('radio-shadow').content.cloneNode(true)); + this.addShadowRoot(new sky.ShadowRoot(module.document.findId('radio-shadow').content.cloneNode(true))); } get checked () { return this.hasAttribute('checked'); @@ -48,7 +48,7 @@ SKY MODULE - radio button and radio button group + From 681ec14ced93c7b44695d68c3ad81558e9b6c853 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 29 Oct 2014 15:21:28 -0700 Subject: [PATCH 050/732] Use module.exports rather than this.exports R=esprehn@chromium.org Review URL: https://codereview.chromium.org/687263005 --- .../tests/custom-elements/resources/document-register-fuzz.sky | 2 +- engine/src/flutter/tests/modules/resources/intermediate.sky | 2 +- engine/src/flutter/tests/modules/resources/pass.sky | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.sky b/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.sky index bf6c66a689..494af737dd 100644 --- a/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.sky +++ b/engine/src/flutter/tests/custom-elements/resources/document-register-fuzz.sky @@ -52,7 +52,7 @@ function register(name, options) } catch (e) { console.log(e); } } -this.exports = { +module.exports = { setupObjectHooks: setupObjectHooks, exerciseDocumentRegister: exerciseDocumentRegister, register: register, diff --git a/engine/src/flutter/tests/modules/resources/intermediate.sky b/engine/src/flutter/tests/modules/resources/intermediate.sky index 57fc7f5731..3884a41e42 100644 --- a/engine/src/flutter/tests/modules/resources/intermediate.sky +++ b/engine/src/flutter/tests/modules/resources/intermediate.sky @@ -1,7 +1,7 @@ diff --git a/engine/src/flutter/tests/modules/resources/pass.sky b/engine/src/flutter/tests/modules/resources/pass.sky index c98a6a9dda..8e9cf9b54e 100644 --- a/engine/src/flutter/tests/modules/resources/pass.sky +++ b/engine/src/flutter/tests/modules/resources/pass.sky @@ -1,3 +1,3 @@ From dc0521fb435a0b2f03644db84b28622779f96776 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 30 Oct 2014 13:55:59 -0700 Subject: [PATCH 051/732] Add support for Element#getAttributes As described in //sky/specs/apis.md R=esprehn@chromium.org Review URL: https://codereview.chromium.org/691893002 --- .../lowlevel/attribute-collection-expected.txt | 13 +++++++------ .../flutter/tests/lowlevel/attribute-collection.sky | 10 ++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt b/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt index 7ddea59e80..09e1d8f600 100644 --- a/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt +++ b/engine/src/flutter/tests/lowlevel/attribute-collection-expected.txt @@ -1,9 +1,10 @@ -Running 5 tests +Running 6 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 +ok 3 Attribute collection should get all at once +ok 4 Attribute collection should set by name +ok 5 Attribute collection should be case sensitive +ok 6 Attribute collection should live update +6 tests +6 pass 0 fail diff --git a/engine/src/flutter/tests/lowlevel/attribute-collection.sky b/engine/src/flutter/tests/lowlevel/attribute-collection.sky index c6380e0d59..33817def46 100644 --- a/engine/src/flutter/tests/lowlevel/attribute-collection.sky +++ b/engine/src/flutter/tests/lowlevel/attribute-collection.sky @@ -24,6 +24,16 @@ describe("Attribute collection", function() { assert.equal(div.attributes.attr0.value, "value0"); assert.equal(div.attributes.attr1.value, "value1"); }); + it("should get all at once", function() { + div.setAttribute("attr0", "value0"); + div.setAttribute("attr1", "value1"); + var attrs = div.getAttributes(); + assert.equal(attrs.length, 2); + assert.equal(attrs[0].name, "attr0"); + assert.equal(attrs[0].value, "value0"); + assert.equal(attrs[1].name, "attr1"); + assert.equal(attrs[1].value, "value1"); + }); it("should set by name", function() { div.setAttribute("attrName", "value0"); div.attributes.attrName.value = "new value"; From b0120fd2849a2e938b1f175407429eea6a94069e Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 30 Oct 2014 14:20:45 -0700 Subject: [PATCH 052/732] Make it possible to change the viewport size This makes it possible to change the viewport size which mojo is using. The sky debugger uses this new API to set the viewport to something closer to mobile instead of 800x600 ancient desktop size. :) Still the (800, 600) constant is prevelant throughout mojo (just search for it) and mojo does not seem to fully update when the viewport size changes, so we actually only see 320x600 pixels instead of 320x640 in sky debugger after this change. Mostly this change is about validating that this is the correct way to plumb this information. R=sky@chromium.org Review URL: https://codereview.chromium.org/692693002 --- engine/src/flutter/tools/debugger/debugger.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index e9a77a2f5c..82b0ea154f 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -65,6 +65,8 @@ class SkyDebugger : public mojo::ApplicationDelegate, root_ = root; root_->AddObserver(this); + window_manager_app_->SetViewportSize(gfx::Size(320, 640)); + content_ = mojo::View::Create(view_manager_); content_->SetBounds(root_->bounds()); root_->AddChild(content_); From 2c27800c53ef79c68751dad27ad6187a484b6ce5 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 30 Oct 2014 15:38:30 -0700 Subject: [PATCH 053/732] Add support for directory listings in sky_server. Unfortunate these aren't very useful since we can't actually click on links, nor do navigations work anyway... TBR=abarth@chromium.org Review URL: https://codereview.chromium.org/690133002 --- engine/src/flutter/tools/sky_server | 21 ++++ engine/src/flutter/tools/staticdirindex.py | 120 +++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 engine/src/flutter/tools/staticdirindex.py diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index 5308b2de9e..bd40138855 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -6,6 +6,7 @@ import argparse import os import cherrypy +import staticdirindex BUILD_DIRECTORY = 'out' @@ -16,6 +17,25 @@ SKY_ROOT = os.path.join(SRC_ROOT, 'sky') GEN_ROOT = os.path.join(SRC_ROOT, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen') +# FIXME: This should be replaced by just json and inflated into DOM client-side. +def skydir(section="", dir="", path="", **kwargs): + url = "%s%s" % (cherrypy.request.headers.get('Host', ''), + cherrypy.request.path_info) + sky = "
" + sky += "" + sky += '
Listing for: ' + url +'
' + for _, dir_names, file_names in os.walk(path.rstrip(r"\/")): + for dir_name in sorted(dir_names): + sky += "%s/\n" % (dir_name, dir_name) + + del dir_names[:] # limit to one level + + for file_name in sorted(file_names): + sky += "%s\n" % (file_name, file_name) + return sky + "
" + + # FIXME: This doesn't yet support directory listings. We'll do something like: # http://tools.cherrypy.org/wiki/staticdirindex # but have it spit .sky instead of HTML @@ -43,6 +63,7 @@ def main(): '/': { 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.abspath(args.app_path), + 'tools.staticdir.indexlister': skydir, }, '/mojo': { 'tools.staticdir.on': True, diff --git a/engine/src/flutter/tools/staticdirindex.py b/engine/src/flutter/tools/staticdirindex.py new file mode 100644 index 0000000000..35eded7fbf --- /dev/null +++ b/engine/src/flutter/tools/staticdirindex.py @@ -0,0 +1,120 @@ +# From http://tools.cherrypy.org/wiki/staticdirindex +# CherryPy code is covered under a BSD License: +# https://bitbucket.org/cherrypy/cherrypy/src/697c7af588b8/cherrypy/LICENSE.txt + +import os +import re +import stat +import urllib +import cherrypy +from cherrypy.lib import cptools, http + +# Undercover kludge to wrap staticdir +from cherrypy.lib.static import staticdir + +def staticdirindex(section, dir, root="", match="", content_types=None, + index="", indexlistermatch="", indexlister=None, **kwargs): + """Serve a directory index listing for a dir. + + Compatibility alert: staticdirindex is built on and is dependent on + staticdir and its configurations. staticdirindex only works effectively + in locations where staticdir is also configured. staticdirindex is + coded to allow easy integration with staticdir, if demand warrants. + + indexlister must be configured, or no function is performed. + indexlister should be a callable that accepts the following parameters: + section: same as for staticdir (and implicitly calculated for it) + dir: same as for staticdir, but already combined with root + path: combination of section and dir + + Other parameters that are configured for staticdirindex will be passed + on to indexlister. + + Should use priorty > than that of staticdir, so that only directories not + served by staticdir, call staticdirindex. + +""" + # first call old staticdir, and see if it does anything + sdret = staticdir( section, dir, root, match, content_types, index ) + if sdret: + return True + + # if not, then see if we are configured to do anything + if indexlister is None: + return False + + req = cherrypy.request + response = cherrypy.response + + match = indexlistermatch + + # N.B. filename ending in a slash or not does not imply a directory + # the following block of code directly copied from static.py staticdir + if match and not re.search(match, cherrypy.request.path_info): + return False + + # Allow the use of '~' to refer to a user's home directory. + dir = os.path.expanduser(dir) + + # If dir is relative, make absolute using "root". + if not os.path.isabs(dir): + if not root: + msg = "Static dir requires an absolute dir (or root)." + raise ValueError(msg) + dir = os.path.join(root, dir) + + # Determine where we are in the object tree relative to 'section' + # (where the static tool was defined). + if section == 'global': + section = "/" + section = section.rstrip(r"\/") + branch = cherrypy.request.path_info[len(section) + 1:] + branch = urllib.unquote(branch.lstrip(r"\/")) + + # If branch is "", filename will end in a slash + filename = os.path.join(dir, branch) + + # There's a chance that the branch pulled from the URL might + # have ".." or similar uplevel attacks in it. Check that the final + # filename is a child of dir. + if not os.path.normpath(filename).startswith(os.path.normpath(dir)): + raise cherrypy.HTTPError(403) # Forbidden + # the above block of code directly copied from static.py staticdir + # N.B. filename ending in a slash or not does not imply a directory + + # Check if path is a directory. + + path = filename + # The following block of code copied from static.py serve_file + + # If path is relative, users should fix it by making path absolute. + # That is, CherryPy should not guess where the application root is. + # It certainly should *not* use cwd (since CP may be invoked from a + # variety of paths). If using tools.static, you can make your relative + # paths become absolute by supplying a value for "tools.static.root". + if not os.path.isabs(path): + raise ValueError("'%s' is not an absolute path." % path) + + try: + st = os.stat(path) + except OSError: + # The above block of code copied from static.py serve_file + + return False + + if stat.S_ISDIR(st.st_mode): + + # Set the Last-Modified response header, so that + # modified-since validation code can work. + response.headers['Last-Modified'] = http.HTTPDate(st.st_mtime) + cptools.validate_since() + response.body = indexlister( section=section, dir=dir, path=path, + **kwargs ) + response.headers['Content-Type'] = 'text/html' + req.is_index = True + return True + + return False + +# Replace the real staticdir with our version +cherrypy.tools.staticdir = cherrypy._cptools.HandlerTool( staticdirindex ) From 3687a4515bf0edfe7d159989cd20156b739b2291 Mon Sep 17 00:00:00 2001 From: Hixie Date: Fri, 31 Oct 2014 10:16:37 -0700 Subject: [PATCH 054/732] Specs: Simplify the platform by only having one shadow tree per element. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/694613002 --- engine/src/flutter/examples/radio.sky | 118 ++++++++++++++------------ 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index ec666d9ec9..5c9be9dbf1 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -11,32 +11,36 @@ SKY MODULE - radio button and radio button group @@ -47,34 +51,38 @@ SKY MODULE - radio button and radio button group From 3d7beea154af49c95e523f36068d7b1c751340a3 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 31 Oct 2014 10:32:31 -0700 Subject: [PATCH 055/732] Attempt to make skydb more user-friendly Automatically shut-down the sky_server when quitting. Always start the skyserver at the mojo-root instead of the parent directory to the path. Log when starting a sky_server outside the mojo root. Re-use already running sky_servers when possible. R=esprehn@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/679333005 --- engine/src/flutter/tools/skydb | 109 +++++++++++++++++++++------------ 1 file changed, 71 insertions(+), 38 deletions(-) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index a66cc0e21d..a20b6ff1b6 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -8,13 +8,16 @@ import os import subprocess import sys import urlparse +import logging +import socket; -BUILD_DIRECTORY = 'out' -CONFIG_DIRECTORY = 'Debug' +OUT_DIR = 'out' +CONFIG_NAME = 'Debug' SKY_TOOLS_DIRECTORY = os.path.abspath(os.path.join(__file__, os.pardir)) -MOJO_SHELL_PATH = os.path.abspath(os.path.join(SKY_TOOLS_DIRECTORY, os.pardir, - os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell')) +MOJO_ROOT = os.path.abspath(os.path.join(SKY_TOOLS_DIRECTORY, os.pardir, + os.pardir)) +MOJO_SHELL_PATH = os.path.join(MOJO_ROOT, OUT_DIR, CONFIG_NAME, 'mojo_shell') SUPPORTED_MIME_TYPES = [ 'text/html', @@ -22,47 +25,77 @@ SUPPORTED_MIME_TYPES = [ 'text/plain', ] -def start_http_server_for_file(path): - HTTP_PORT = 9999 - server_command = [ - os.path.join(SKY_TOOLS_DIRECTORY, 'sky_server'), - os.path.dirname(os.path.abspath(path)), - str(HTTP_PORT), - ] - subprocess.Popen(server_command) - return 'http://localhost:%s/%s' % (HTTP_PORT, os.path.basename(path)) +class SkyDebugger(object): + @staticmethod + def _port_in_use(port): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + return sock.connect_ex(('localhost', port)) == 0 + def _start_http_server_for_file(self, path): + HTTP_PORT = 9999 -def main(): - parser = argparse.ArgumentParser(description='Sky launcher/debugger') - parser.add_argument('--gdb', action='store_true') - parser.add_argument('url', nargs='?', type=str) - args = parser.parse_args() + path = os.path.abspath(path) + if os.path.commonprefix([path, MOJO_ROOT]) == MOJO_ROOT: + server_root = MOJO_ROOT + else: + server_root = os.path.dirname(path) + logging.warn( + '%s is outside of mojo root, using %s as server root' % + (path, server_root)) + relative_path = os.path.relpath(path, server_root) - content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') - for mime_type in SUPPORTED_MIME_TYPES] - shell_command = [ - MOJO_SHELL_PATH, - '--v=1', - '--content-handlers=%s' % ','.join(content_handlers), - '--url-mappings=mojo:window_manager=mojo:sky_debugger', - 'mojo:window_manager', - ] - if args.url: - url = args.url - if not urlparse.urlparse(url).scheme: - url = start_http_server_for_file(url) + if self._port_in_use(HTTP_PORT): + logging.warn( + 'Port %s already in use, assuming custom sky_server started.') + else: + server_command = [ + os.path.join(SKY_TOOLS_DIRECTORY, 'sky_server'), + server_root, + str(HTTP_PORT), + ] + self._sky_server = subprocess.Popen(server_command) + return 'http://localhost:%s/%s' % (HTTP_PORT, relative_path) - prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % url - shell_command.append(prompt_args) - if args.gdb: - shell_command = ['gdb', '--args'] + shell_command + def main(self): + logging.basicConfig(level=logging.INFO) - subprocess.check_call(shell_command) + parser = argparse.ArgumentParser(description='Sky launcher/debugger') + parser.add_argument('--gdb', action='store_true') + parser.add_argument('url', nargs='?', type=str) + args = parser.parse_args() + + content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/') + for mime_type in SUPPORTED_MIME_TYPES] + shell_command = [ + MOJO_SHELL_PATH, + '--v=1', + '--content-handlers=%s' % ','.join(content_handlers), + '--url-mappings=mojo:window_manager=mojo:sky_debugger', + 'mojo:window_manager', + ] + if args.url: + url = args.url + if not urlparse.urlparse(url).scheme: + url = self._start_http_server_for_file(url) + + prompt_args = '--args-for=mojo://sky_debugger_prompt/ %s' % url + shell_command.append(prompt_args) + if args.gdb: + shell_command = ['gdb', '--args'] + shell_command + + subprocess.check_call(shell_command) + + def shutdown(self): + print "Quitting" + if self._sky_server: + self._sky_server.terminate() if __name__ == '__main__': + skydb = SkyDebugger() try: - main() + skydb.main() except (KeyboardInterrupt, SystemExit): - print "Quitting" + pass + finally: + skydb.shutdown() From 5e8e6e226e612e7b2f5cc4438b67a335cc44055a Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 31 Oct 2014 11:44:03 -0700 Subject: [PATCH 056/732] Add instructions for building Release to HACKING.md R=ojan@chromium.org, eseidel@chromium.org Review URL: https://codereview.chromium.org/693163003 --- engine/src/flutter/HACKING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/HACKING.md b/engine/src/flutter/HACKING.md index 65f8811007..63f4248397 100644 --- a/engine/src/flutter/HACKING.md +++ b/engine/src/flutter/HACKING.md @@ -5,7 +5,12 @@ Building -------- * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mojo) -* Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` +* Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` for a debug build. + +If you want to build release, run the following commands: + +* ``gn gen out/Release --args="is_debug=false"`` +* ``ninja -C out/Release sky`` Running applications -------------------- @@ -13,9 +18,11 @@ Running applications * ``./sky/tools/skydb [url]`` * You should see a ``(skydb)`` prompt * Type ``help`` to see the list of available commands + * Note: skydb is currently hard-coded to use ``//out/Debug`` * ``./sky/tools/test_sky --debug`` - * This should run the tests + * This runs the tests against ``//out/Debug``. If you want to run against + ``//out/Release``, omit the ``--debug`` flag. Running tests manually ---------------------- From 4899c541104f97bb57e141116bedc0e3c556cb81 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 31 Oct 2014 11:46:02 -0700 Subject: [PATCH 057/732] Fix urls under /sky to work again Turns out that the /sky mapping to the gen directory was interfering with our new pattern of mapping the actual /sky directory. So now we use a more restrictive mapping pattern of only mapping /sky/services, similar for /mojo/services and /mojo/public. Fixed an exception of not finding _sky_server when a custom sky_server was already running. R=abarth@chromium.org Review URL: https://codereview.chromium.org/692163002 --- engine/src/flutter/tools/sky_server | 13 ++++++------- engine/src/flutter/tools/skydb | 6 +++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index bd40138855..0fe0fe91ff 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -65,18 +65,17 @@ def main(): 'tools.staticdir.dir': os.path.abspath(args.app_path), 'tools.staticdir.indexlister': skydir, }, - '/mojo': { + '/mojo/public': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'public'), }, - '/sky': { + '/mojo/services': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'services'), }, - '/sky/framework': { + '/sky/services': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': - os.path.join(SKY_ROOT, 'framework'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky', 'services'), }, } cherrypy.quickstart(config=config) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index a20b6ff1b6..d0340cdd08 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -26,6 +26,9 @@ SUPPORTED_MIME_TYPES = [ ] class SkyDebugger(object): + def __init__(self): + self._sky_server = None + @staticmethod def _port_in_use(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -46,7 +49,8 @@ class SkyDebugger(object): if self._port_in_use(HTTP_PORT): logging.warn( - 'Port %s already in use, assuming custom sky_server started.') + 'Port %s already in use, assuming custom sky_server started.' % + HTTP_PORT) else: server_command = [ os.path.join(SKY_TOOLS_DIRECTORY, 'sky_server'), From 60314d529b3f88b72a04e2380092483344f24564 Mon Sep 17 00:00:00 2001 From: Viet-Trung Luu Date: Fri, 31 Oct 2014 12:59:52 -0700 Subject: [PATCH 058/732] mojom: Remove braces from module statements and make them come first. So, instead of: import "bar.mojom"; module foo { ... } You'll do: module foo; import "bar.mojom"; ... (Note that the grammar in the parser doesn't capture the ordering constraint. It's hard to do so while keeping the grammar LR(1) AFAICT. So instead we enforce the ordering "manually".) Also delete mojo/spy/PRESUBMIT.py since it's broken. We'll delete mojo/spy separately. R=jamesr@chromium.org Review URL: https://codereview.chromium.org/687793004 --- engine/src/flutter/tools/debugger/debugger.mojom | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/src/flutter/tools/debugger/debugger.mojom b/engine/src/flutter/tools/debugger/debugger.mojom index df3399e27c..75e2f2f8a8 100644 --- a/engine/src/flutter/tools/debugger/debugger.mojom +++ b/engine/src/flutter/tools/debugger/debugger.mojom @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module sky { +module sky; interface Debugger { NavigateToURL(string url); InjectInspector(); }; - -} From d11c87965942208e7c2f1e07696eb8cecaffb6b2 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 31 Oct 2014 13:17:15 -0700 Subject: [PATCH 059/732] Make clicking links work in SkyDB Now the SkyDebugger implements NavigatorHost and actually navigates the mojo::View. This CL pulled a big refactor of sky/tools/debugger to separate out MojoMain from debugger.cc. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/690363002 --- engine/src/flutter/tools/debugger/BUILD.gn | 5 + engine/src/flutter/tools/debugger/DEPS | 5 + engine/src/flutter/tools/debugger/debugger.cc | 237 ++++++++---------- engine/src/flutter/tools/debugger/debugger.h | 80 ++++++ .../src/flutter/tools/debugger/focus_rules.cc | 2 + .../src/flutter/tools/debugger/focus_rules.h | 2 + engine/src/flutter/tools/debugger/main.cc | 13 + .../tools/debugger/navigator_host_impl.cc | 31 +++ .../tools/debugger/navigator_host_impl.h | 37 +++ 9 files changed, 278 insertions(+), 134 deletions(-) create mode 100644 engine/src/flutter/tools/debugger/DEPS create mode 100644 engine/src/flutter/tools/debugger/debugger.h create mode 100644 engine/src/flutter/tools/debugger/main.cc create mode 100644 engine/src/flutter/tools/debugger/navigator_host_impl.cc create mode 100644 engine/src/flutter/tools/debugger/navigator_host_impl.h diff --git a/engine/src/flutter/tools/debugger/BUILD.gn b/engine/src/flutter/tools/debugger/BUILD.gn index 1efddf46f9..199269cc46 100644 --- a/engine/src/flutter/tools/debugger/BUILD.gn +++ b/engine/src/flutter/tools/debugger/BUILD.gn @@ -16,8 +16,12 @@ group("debugger") { shared_library("sky_debugger") { sources = [ "debugger.cc", + "debugger.h", "focus_rules.cc", "focus_rules.h", + "main.cc", + "navigator_host_impl.cc", + "navigator_host_impl.h", ] deps = [ @@ -30,6 +34,7 @@ shared_library("sky_debugger") { "//mojo/public/cpp/utility", "//mojo/services/public/cpp/view_manager", "//mojo/services/public/interfaces/input_events:input_events", + "//mojo/services/public/interfaces/navigation", "//mojo/services/window_manager:lib", "//sky/viewer:bindings", "//ui/aura:aura", diff --git a/engine/src/flutter/tools/debugger/DEPS b/engine/src/flutter/tools/debugger/DEPS new file mode 100644 index 0000000000..f97d96c0d2 --- /dev/null +++ b/engine/src/flutter/tools/debugger/DEPS @@ -0,0 +1,5 @@ +include_rules = [ + "+mojo/public", + "+mojo/application", + "+mojo/services", +] diff --git a/engine/src/flutter/tools/debugger/debugger.cc b/engine/src/flutter/tools/debugger/debugger.cc index 82b0ea154f..a764ae5957 100644 --- a/engine/src/flutter/tools/debugger/debugger.cc +++ b/engine/src/flutter/tools/debugger/debugger.cc @@ -2,141 +2,110 @@ // 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" -#include "sky/viewer/services/inspector.mojom.h" +#include "sky/tools/debugger/debugger.h" namespace sky { +namespace debugger { -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 imported_services) override { - view_manager_ = view_manager; - - root_ = root; - root_->AddObserver(this); - - window_manager_app_->SetViewportSize(gfx::Size(320, 640)); - - content_ = mojo::View::Create(view_manager_); - content_->SetBounds(root_->bounds()); - root_->AddChild(content_); - - window_manager_app_->InitFocus( - new FocusRules(window_manager_app_.get(), content_)); - - if (!pending_url_.empty()) - NavigateToURL(pending_url_); - } - - virtual void OnViewManagerDisconnected( - mojo::ViewManager* view_manager) override { - CHECK(false); // FIXME: This is dead code, why? - view_manager_ = nullptr; - root_ = nullptr; - } - - virtual void OnViewDestroyed(mojo::View* view) override { - CHECK(false); // FIXME: This is dead code, why? - view->RemoveObserver(this); - } - - virtual void OnViewBoundsChanged(mojo::View* view, - const mojo::Rect& old_bounds, - const mojo::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 { - // We can get Navigate commands before we've actually been - // embedded into the view and content_ created. - // Just save the last one. - if (content_) { - scoped_ptr exported_services( - new mojo::ServiceProviderImpl()); - viewer_services_ = content_->Embed(url, exported_services.Pass()); - } else { - pending_url_ = url; - } - } - - virtual void InjectInspector() override { - InspectorServicePtr inspector_service; - mojo::ConnectToService(viewer_services_.get(), &inspector_service); - inspector_service->Inject(); - } - - scoped_ptr window_manager_app_; - - mojo::ViewManager* view_manager_; - mojo::View* root_; - mojo::View* content_; - std::string pending_url_; - - scoped_ptr viewer_services_; - - DISALLOW_COPY_AND_ASSIGN(SkyDebugger); -}; - -} // namespace sky - -MojoResult MojoMain(MojoHandle shell_handle) { - mojo::ApplicationRunnerChromium runner(new sky::SkyDebugger); - return runner.Run(shell_handle); +SkyDebugger::SkyDebugger() + : window_manager_app_(new mojo::WindowManagerApp(this, nullptr)), + view_manager_(nullptr), + root_(nullptr), + content_(nullptr), + navigator_host_factory_(this), + weak_factory_(this) { } + +SkyDebugger::~SkyDebugger() { +} + +base::WeakPtr SkyDebugger::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +void SkyDebugger::Initialize(mojo::ApplicationImpl* app) { + window_manager_app_->Initialize(app); + app->ConnectToApplication("mojo:sky_debugger_prompt"); +} + +bool SkyDebugger::ConfigureIncomingConnection( + mojo::ApplicationConnection* connection) { + window_manager_app_->ConfigureIncomingConnection(connection); + connection->AddService(this); + return true; +} + +bool SkyDebugger::ConfigureOutgoingConnection( + mojo::ApplicationConnection* connection) { + window_manager_app_->ConfigureOutgoingConnection(connection); + connection->AddService(this); + return true; +} + +void SkyDebugger::OnEmbed( + mojo::ViewManager* view_manager, + mojo::View* root, + mojo::ServiceProviderImpl* exported_services, + scoped_ptr imported_services) { + view_manager_ = view_manager; + + root_ = root; + root_->AddObserver(this); + + window_manager_app_->SetViewportSize(gfx::Size(320, 640)); + + content_ = mojo::View::Create(view_manager_); + content_->SetBounds(root_->bounds()); + root_->AddChild(content_); + + window_manager_app_->InitFocus( + new FocusRules(window_manager_app_.get(), content_)); + + if (!pending_url_.empty()) + NavigateToURL(pending_url_); +} + +void SkyDebugger::OnViewManagerDisconnected(mojo::ViewManager* view_manager) { + CHECK(false); // FIXME: This is dead code, why? + view_manager_ = nullptr; + root_ = nullptr; +} + +void SkyDebugger::OnViewDestroyed(mojo::View* view) { + CHECK(false); // FIXME: This is dead code, why? + view->RemoveObserver(this); +} + +void SkyDebugger::OnViewBoundsChanged(mojo::View* view, + const mojo::Rect& old_bounds, + const mojo::Rect& new_bounds) { + content_->SetBounds(new_bounds); +} + +void SkyDebugger::Create(mojo::ApplicationConnection* connection, + mojo::InterfaceRequest request) { + mojo::WeakBindToRequest(this, &request); +} + +void SkyDebugger::NavigateToURL(const mojo::String& url) { + // We can get Navigate commands before we've actually been + // embedded into the view and content_ created. + // Just save the last one. + if (content_) { + scoped_ptr exported_services( + new mojo::ServiceProviderImpl()); + exported_services->AddService(&navigator_host_factory_); + viewer_services_ = content_->Embed(url, exported_services.Pass()); + } else { + pending_url_ = url; + } +} + +void SkyDebugger::InjectInspector() { + InspectorServicePtr inspector_service; + mojo::ConnectToService(viewer_services_.get(), &inspector_service); + inspector_service->Inject(); +} + +} // namespace debugger +} // namespace sky diff --git a/engine/src/flutter/tools/debugger/debugger.h b/engine/src/flutter/tools/debugger/debugger.h new file mode 100644 index 0000000000..4bd60db068 --- /dev/null +++ b/engine/src/flutter/tools/debugger/debugger.h @@ -0,0 +1,80 @@ +// 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/memory/weak_ptr.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/public/interfaces/navigation/navigation.mojom.h" +#include "mojo/services/window_manager/window_manager_app.h" +#include "mojo/services/window_manager/window_manager_delegate.h" +#include "sky/tools/debugger/debugger.mojom.h" +#include "sky/tools/debugger/focus_rules.h" +#include "sky/tools/debugger/navigator_host_impl.h" +#include "sky/viewer/services/inspector.mojom.h" + +namespace sky { +namespace debugger { + +class SkyDebugger : public mojo::ApplicationDelegate, + public mojo::ViewManagerDelegate, + public mojo::ViewObserver, + public mojo::InterfaceFactory, + public mojo::InterfaceImpl { + public: + SkyDebugger(); + virtual ~SkyDebugger(); + + base::WeakPtr GetWeakPtr(); + + // Overridden from Debugger + void NavigateToURL(const mojo::String& url) override; + void InjectInspector() override; + + private: + // Overridden from mojo::ApplicationDelegate: + void Initialize(mojo::ApplicationImpl* app) override; + bool ConfigureIncomingConnection( + mojo::ApplicationConnection* connection) override; + bool ConfigureOutgoingConnection( + mojo::ApplicationConnection* connection) override; + + // Overridden from mojo::ViewManagerDelegate: + void OnEmbed(mojo::ViewManager* view_manager, + mojo::View* root, + mojo::ServiceProviderImpl* exported_services, + scoped_ptr imported_services) override; + void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; + void OnViewDestroyed(mojo::View* view) override; + void OnViewBoundsChanged(mojo::View* view, + const mojo::Rect& old_bounds, + const mojo::Rect& new_bounds) override; + + // Overridden from InterfaceFactory + void Create(mojo::ApplicationConnection* connection, + mojo::InterfaceRequest request) override; + + scoped_ptr window_manager_app_; + + mojo::ViewManager* view_manager_; + mojo::View* root_; + mojo::View* content_; + std::string pending_url_; + + scoped_ptr viewer_services_; + + NavigatorHostFactory navigator_host_factory_; + + base::WeakPtrFactory weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(SkyDebugger); +}; + +} // namespace debugger +} // namespace sky diff --git a/engine/src/flutter/tools/debugger/focus_rules.cc b/engine/src/flutter/tools/debugger/focus_rules.cc index fb193d8b4f..68eca6223c 100644 --- a/engine/src/flutter/tools/debugger/focus_rules.cc +++ b/engine/src/flutter/tools/debugger/focus_rules.cc @@ -5,6 +5,7 @@ #include "sky/tools/debugger/focus_rules.h" namespace sky { +namespace debugger { FocusRules::FocusRules(mojo::WindowManagerApp* window_manager_app, mojo::View* content) @@ -56,4 +57,5 @@ aura::Window* FocusRules::GetNextActivatableWindow(aura::Window* ignore) const { return NULL; } +} // namespace debugger } // namespace sky diff --git a/engine/src/flutter/tools/debugger/focus_rules.h b/engine/src/flutter/tools/debugger/focus_rules.h index ee13cafed8..fa5a91974f 100644 --- a/engine/src/flutter/tools/debugger/focus_rules.h +++ b/engine/src/flutter/tools/debugger/focus_rules.h @@ -10,6 +10,7 @@ #include "ui/wm/core/focus_rules.h" namespace sky { +namespace debugger { class FocusRules : public wm::FocusRules { public: @@ -32,6 +33,7 @@ class FocusRules : public wm::FocusRules { DISALLOW_COPY_AND_ASSIGN(FocusRules); }; +} // namespace debugger } // namespace sky #endif // SKY_TOOLS_DEBUGGER_FOCUS_RULES_H_ diff --git a/engine/src/flutter/tools/debugger/main.cc b/engine/src/flutter/tools/debugger/main.cc new file mode 100644 index 0000000000..9c6ed847e7 --- /dev/null +++ b/engine/src/flutter/tools/debugger/main.cc @@ -0,0 +1,13 @@ +// 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 "sky/tools/debugger/debugger.h" + +MojoResult MojoMain(MojoHandle shell_handle) { + mojo::ApplicationRunnerChromium runner(new sky::debugger::SkyDebugger); + return runner.Run(shell_handle); +} diff --git a/engine/src/flutter/tools/debugger/navigator_host_impl.cc b/engine/src/flutter/tools/debugger/navigator_host_impl.cc new file mode 100644 index 0000000000..5422b6400b --- /dev/null +++ b/engine/src/flutter/tools/debugger/navigator_host_impl.cc @@ -0,0 +1,31 @@ +// 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/navigator_host_impl.h" + +#include "sky/tools/debugger/debugger.h" + +namespace sky { +namespace debugger { + +NavigatorHostImpl::NavigatorHostImpl(SkyDebugger* debugger) + : debugger_(debugger->GetWeakPtr()) { +} + +NavigatorHostImpl::~NavigatorHostImpl() { +} + +void NavigatorHostImpl::DidNavigateLocally(const mojo::String& url) { + // TODO(abarth): Do something interesting. +} + +void NavigatorHostImpl::RequestNavigate(mojo::Target target, + mojo::URLRequestPtr request) { + if (!debugger_) + return; + debugger_->NavigateToURL(request->url); +} + +} // namespace debugger +} // namespace sky diff --git a/engine/src/flutter/tools/debugger/navigator_host_impl.h b/engine/src/flutter/tools/debugger/navigator_host_impl.h new file mode 100644 index 0000000000..0d7c7e68b5 --- /dev/null +++ b/engine/src/flutter/tools/debugger/navigator_host_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_DEBUGGER_NAVIGATOR_HOST_IMPL_H_ +#define SKY_TOOLS_DEBUGGER_NAVIGATOR_HOST_IMPL_H_ + +#include "base/memory/weak_ptr.h" +#include "mojo/public/cpp/application/interface_factory_impl.h" +#include "mojo/services/public/interfaces/navigation/navigation.mojom.h" +#include "sky/tools/debugger/debugger.mojom.h" + +namespace sky { +namespace debugger { +class SkyDebugger; + +class NavigatorHostImpl : public mojo::InterfaceImpl { + public: + explicit NavigatorHostImpl(SkyDebugger*); + ~NavigatorHostImpl(); + + private: + void DidNavigateLocally(const mojo::String& url) override; + void RequestNavigate(mojo::Target target, mojo::URLRequestPtr request) override; + + base::WeakPtr debugger_; + + DISALLOW_COPY_AND_ASSIGN(NavigatorHostImpl); +}; + +typedef mojo::InterfaceFactoryImplWithContext< + NavigatorHostImpl, SkyDebugger> NavigatorHostFactory; + +} // namespace debugger +} // namespace sky + +#endif // SKY_TOOLS_DEBUGGER_NAVIGATOR_HOST_IMPL_H_ From 80c734eefcd1a6c05bf71795f368ce44a37dc416 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 31 Oct 2014 14:46:40 -0700 Subject: [PATCH 060/732] Switch "html" Mojo modules to the Sky module system These never really worked with HTML imports. This CL updates them to use a more modern version of the Sky module system so we can delete the old this.exports pattern. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/697723003 --- engine/src/flutter/tests/services/buffer.sky | 2 +- engine/src/flutter/tests/services/codec.sky | 2 +- engine/src/flutter/tests/services/core.sky | 2 +- engine/src/flutter/tests/services/network.sky | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/src/flutter/tests/services/buffer.sky b/engine/src/flutter/tests/services/buffer.sky index 82a82786ad..1f2d6b2df4 100644 --- a/engine/src/flutter/tests/services/buffer.sky +++ b/engine/src/flutter/tests/services/buffer.sky @@ -1,6 +1,6 @@ - +
FAIL
diff --git a/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt b/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt index 1afd06f8e3..e66a35924f 100644 --- a/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt +++ b/engine/src/flutter/tests/mutation-observer/observe-attributes-expected.txt @@ -1,4 +1,4 @@ -Running 15 tests +Running 14 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 @@ -13,7 +13,6 @@ ok 11 MutationObserver.observe on attributes should respect different attributeF 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 +14 tests +14 pass 0 fail diff --git a/engine/src/flutter/tests/mutation-observer/observe-attributes.sky b/engine/src/flutter/tests/mutation-observer/observe-attributes.sky index e85651110e..9710bf0e51 100644 --- a/engine/src/flutter/tests/mutation-observer/observe-attributes.sky +++ b/engine/src/flutter/tests/mutation-observer/observe-attributes.sky @@ -563,38 +563,6 @@ describe('MutationObserver.observe on attributes', function() { start(); }); - - it('should create records when mutating through the attribute collection', function(done) { - var observer; - var mutations; - var div; - - function start() { - observer = new MutationObserver(function(records) { - mutations = records; - }); - - div = document.createElement('div'); - div.setAttribute('data-test', 'foo'); - observer.observe(div, { attributes: true, attributeOldValue: true }); - div.attributes['data-test'].value = 'bar'; - - setTimeout(finish, 0); - } - - function finish() { - assert.equal(mutations.length, 1); - assert.equal(mutations[0].target, div); - assert.equal(mutations[0].type, "attributes"); - assert.equal(mutations[0].attributeName, "data-test"); - assert.equal(mutations[0].oldValue, "foo"); - - observer.disconnect(); - done(); - } - - start(); - }); }); From d00fcdf621b3759b641f2575ae6c1dc3ec31e173 Mon Sep 17 00:00:00 2001 From: Hixie Date: Fri, 31 Oct 2014 16:18:46 -0700 Subject: [PATCH 062/732] Specs: make element registrations be per-module, define how they are exported and reexported, rename 'interface' to 'class' in the IDL, add constructors to all registered elements R=esprehn@chromium.org Review URL: https://codereview.chromium.org/695043002 --- engine/src/flutter/README.md | 4 ++-- engine/src/flutter/examples/radio.sky | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/README.md b/engine/src/flutter/README.md index ac26662094..8a5673248d 100644 --- a/engine/src/flutter/README.md +++ b/engine/src/flutter/README.md @@ -72,10 +72,10 @@ SKY MODULE class extends SkyElement { constructor () { this.addEventListener('click', (event) => this.updateTime()); - this.createShadowTree().appendChild('Click to show the time'); + this.shadowRoot.appendChild('Click to show the time'); } updateTime() { - this.shadowTree.firstChild.replaceWith(new Date()); + this.shadowRoot.firstChild.replaceWith(new Date()); } } diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index 5c9be9dbf1..36daa1c349 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -1,6 +1,9 @@ SKY MODULE - radio button and radio button group - + + diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index 0fe0fe91ff..da42f1acf3 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -4,8 +4,9 @@ # found in the LICENSE file. import argparse -import os import cherrypy +import json +import os import staticdirindex @@ -17,29 +18,23 @@ SKY_ROOT = os.path.join(SRC_ROOT, 'sky') GEN_ROOT = os.path.join(SRC_ROOT, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen') -# FIXME: This should be replaced by just json and inflated into DOM client-side. def skydir(section="", dir="", path="", **kwargs): - url = "%s%s" % (cherrypy.request.headers.get('Host', ''), - cherrypy.request.path_info) - sky = "" - sky += "" - sky += '
Listing for: ' + url +'
' + if cherrypy.request.params.get('format') is None: + return '' + result = dict() + result['directories'] = [] + result['files'] = [] for _, dir_names, file_names in os.walk(path.rstrip(r"\/")): for dir_name in sorted(dir_names): - sky += "%s/\n" % (dir_name, dir_name) + result["directories"].append(dir_name) del dir_names[:] # limit to one level for file_name in sorted(file_names): - sky += "%s\n" % (file_name, file_name) - return sky + "
" + result["files"].append(file_name) + return json.dumps(result) -# FIXME: This doesn't yet support directory listings. We'll do something like: -# http://tools.cherrypy.org/wiki/staticdirindex -# but have it spit .sky instead of HTML - def main(): parser = argparse.ArgumentParser(description='Sky development server') parser.add_argument('-v', '--verbose', action='store_true', From 8193b29f3ff43b4f566dd43e4f6117a819c8da52 Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 3 Nov 2014 16:52:47 -0800 Subject: [PATCH 067/732] Specs: Drop the concept of late-bound elements. An element can never be upgraded. This has the following implications: - There's no createElement() function any more. If you want to create an element from script, you have to use its constructor. - There's no async element registration. The parser will block until all the imports are imported when you use a tag name of a custom element that hasn't been registered yet, in case one of the imports defines it. - If you try to construct a non-registered element in markup, it turns into an element. -
, , and are new built-in elements. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/695423004 --- engine/src/flutter/examples/home.sky | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/examples/home.sky b/engine/src/flutter/examples/home.sky index 5cfbaecab4..7580b5eb72 100644 --- a/engine/src/flutter/examples/home.sky +++ b/engine/src/flutter/examples/home.sky @@ -1,9 +1,9 @@ #!mojo mojo:sky - +
-

about:blank

-

Welcome to Sky!

- +
about:blank
+
Welcome to Sky!
+
From 0686c96cc55e3ebd97a7faf4a75ba4b9728e03ed Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 3 Nov 2014 19:05:48 -0800 Subject: [PATCH 068/732] Don't GC message pipes that have an in-flight request In mojom, there's a notion of a request/response pair. This CL teaches the JS bindings not to GC a message pipe after a request has been issued but before the response has been received. R=hansmuller@chromium.org Review URL: https://codereview.chromium.org/696373003 --- engine/src/flutter/examples/file-browser.sky | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/examples/file-browser.sky b/engine/src/flutter/examples/file-browser.sky index 6d02f84839..43c1267b30 100644 --- a/engine/src/flutter/examples/file-browser.sky +++ b/engine/src/flutter/examples/file-browser.sky @@ -28,7 +28,7 @@ SkyElement({ directories: [], attached: function() { this.url = this.ownerDocument.URL; - var xhr = this.xhr_ = new XMLHttpRequest(); + var xhr = new XMLHttpRequest(); xhr.open('GET', this.url + '?format=json'); xhr.onload = (function() { var listing = JSON.parse(xhr.responseText); From 82fe742ec2625e2829b529b340cb18f00181029e Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Mon, 3 Nov 2014 20:46:32 -0800 Subject: [PATCH 069/732] Add the check layout framework for tests. Also add a test for margins. R=abarth@chromium.org Review URL: https://codereview.chromium.org/699113002 --- .../flutter/tests/layout/margins-expected.txt | 5 +++++ engine/src/flutter/tests/layout/margins.sky | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 engine/src/flutter/tests/layout/margins-expected.txt create mode 100644 engine/src/flutter/tests/layout/margins.sky diff --git a/engine/src/flutter/tests/layout/margins-expected.txt b/engine/src/flutter/tests/layout/margins-expected.txt new file mode 100644 index 0000000000..26a08bedaf --- /dev/null +++ b/engine/src/flutter/tests/layout/margins-expected.txt @@ -0,0 +1,5 @@ +FAIL: +
+Expected 10 for clientTop+offsetTop, but got 0, clientTop: 0, + offsetTop: 0. +
+Expected 50 for clientTop+offsetTop, but got 40, clientTop: 0, + offsetTop: 40. diff --git a/engine/src/flutter/tests/layout/margins.sky b/engine/src/flutter/tests/layout/margins.sky new file mode 100644 index 0000000000..7ff9236947 --- /dev/null +++ b/engine/src/flutter/tests/layout/margins.sky @@ -0,0 +1,17 @@ + + + +
+
+
+
+ + +
From 79ea19ffc7f3588c0594cfdca7c30960ed2768d4 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Mon, 3 Nov 2014 21:30:40 -0800 Subject: [PATCH 070/732] Remove margin collapsing. Margin collapsing is a document-oriented feature. For applications it just causes confusion and slowness. margins.sky has failure output because offsetTop is returning the wrong values. That's not new with this patch though. When I look at it visually in skydb, everything seems to be in the right place. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/700743002 --- .../layout/margins-absolute-expected.txt | 1 + .../flutter/tests/layout/margins-absolute.sky | 21 +++++++++++++++++++ .../flutter/tests/layout/margins-expected.txt | 8 +++---- engine/src/flutter/tests/layout/margins.sky | 12 ++++++++--- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 engine/src/flutter/tests/layout/margins-absolute-expected.txt create mode 100644 engine/src/flutter/tests/layout/margins-absolute.sky diff --git a/engine/src/flutter/tests/layout/margins-absolute-expected.txt b/engine/src/flutter/tests/layout/margins-absolute-expected.txt new file mode 100644 index 0000000000..7ef22e9a43 --- /dev/null +++ b/engine/src/flutter/tests/layout/margins-absolute-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/engine/src/flutter/tests/layout/margins-absolute.sky b/engine/src/flutter/tests/layout/margins-absolute.sky new file mode 100644 index 0000000000..02d6a76b58 --- /dev/null +++ b/engine/src/flutter/tests/layout/margins-absolute.sky @@ -0,0 +1,21 @@ + + + +
+
+
+ + +
+ diff --git a/engine/src/flutter/tests/layout/margins-expected.txt b/engine/src/flutter/tests/layout/margins-expected.txt index 26a08bedaf..63bf405cfb 100644 --- a/engine/src/flutter/tests/layout/margins-expected.txt +++ b/engine/src/flutter/tests/layout/margins-expected.txt @@ -1,5 +1,5 @@ FAIL: -
-Expected 10 for clientTop+offsetTop, but got 0, clientTop: 0, + offsetTop: 0. -
-Expected 50 for clientTop+offsetTop, but got 40, clientTop: 0, + offsetTop: 40. +
+Expected 15 for clientTop+offsetTop, but got 10, clientTop: 0, + offsetTop: 10. +
+Expected 65 for clientTop+offsetTop, but got 60, clientTop: 0, + offsetTop: 60. diff --git a/engine/src/flutter/tests/layout/margins.sky b/engine/src/flutter/tests/layout/margins.sky index 7ff9236947..f720072e73 100644 --- a/engine/src/flutter/tests/layout/margins.sky +++ b/engine/src/flutter/tests/layout/margins.sky @@ -1,17 +1,23 @@ -
-
-
+
+ +
+
+ From d1382e4d419188b11ec4c9f7eca0b8e1ad20118b Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Mon, 3 Nov 2014 23:18:39 -0800 Subject: [PATCH 071/732] Remove DOMImplementation. Expose a Document constructor instead. This also exposes that the TemplateBinding library might need more control over the registration context for custom elements. For now we make all documents share the same registration context. R=ojan@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/697363002 --- .../flutter/tests/lowlevel/create-document-expected.txt | 5 +++++ ...ementation-create-document.sky => create-document.sky} | 8 ++++---- engine/src/flutter/tests/lowlevel/createElement.sky | 2 +- .../dom-implementation-create-document-expected.txt | 5 ----- .../flutter/tests/mutation-observer/cross-document.sky | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 engine/src/flutter/tests/lowlevel/create-document-expected.txt rename engine/src/flutter/tests/lowlevel/{dom-implementation-create-document.sky => create-document.sky} (53%) delete mode 100644 engine/src/flutter/tests/lowlevel/dom-implementation-create-document-expected.txt diff --git a/engine/src/flutter/tests/lowlevel/create-document-expected.txt b/engine/src/flutter/tests/lowlevel/create-document-expected.txt new file mode 100644 index 0000000000..74fc7f133a --- /dev/null +++ b/engine/src/flutter/tests/lowlevel/create-document-expected.txt @@ -0,0 +1,5 @@ +Running 1 tests +ok 1 Document should have a constructor +1 tests +1 pass +0 fail diff --git a/engine/src/flutter/tests/lowlevel/dom-implementation-create-document.sky b/engine/src/flutter/tests/lowlevel/create-document.sky similarity index 53% rename from engine/src/flutter/tests/lowlevel/dom-implementation-create-document.sky rename to engine/src/flutter/tests/lowlevel/create-document.sky index 62e65b382b..cb4f7c3f0d 100644 --- a/engine/src/flutter/tests/lowlevel/dom-implementation-create-document.sky +++ b/engine/src/flutter/tests/lowlevel/create-document.sky @@ -2,10 +2,10 @@ diff --git a/engine/src/flutter/benchmarks/resources/runner.sky b/engine/src/flutter/benchmarks/resources/runner.sky new file mode 100644 index 0000000000..eaa1059e07 --- /dev/null +++ b/engine/src/flutter/benchmarks/resources/runner.sky @@ -0,0 +1,81 @@ + diff --git a/engine/src/flutter/tests/modules/load-event-expected.txt b/engine/src/flutter/tests/modules/load-event-expected.txt new file mode 100644 index 0000000000..c3caf918f3 --- /dev/null +++ b/engine/src/flutter/tests/modules/load-event-expected.txt @@ -0,0 +1,2 @@ +PASS: Load event fired. +PASS: pass.sky succesfully exported this string. diff --git a/engine/src/flutter/tests/modules/load-event.sky b/engine/src/flutter/tests/modules/load-event.sky new file mode 100644 index 0000000000..f49c45faae --- /dev/null +++ b/engine/src/flutter/tests/modules/load-event.sky @@ -0,0 +1,17 @@ + + +
FAIL
+
FAIL
+ + + From 160363c27474aadc4c2a7ec29c6c7f74d8378803 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 4 Nov 2014 11:57:02 -0800 Subject: [PATCH 073/732] Specs: define registerElement() more carefully; add an 'end tag parsed' callback; pass the element's module to the constructor when constructing a custom element (these are rather experimental changes and we may want to go a different way on this stuff) Review URL: https://codereview.chromium.org/701873004 --- engine/src/flutter/README.md | 3 +++ engine/src/flutter/examples/radio.sky | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/README.md b/engine/src/flutter/README.md index 8a5673248d..1b4a97e589 100644 --- a/engine/src/flutter/README.md +++ b/engine/src/flutter/README.md @@ -28,9 +28,12 @@ to create custom elements. The following elements are built into the engine: - ``content``: Visually projects descendents of the shadow host - ``shadow``: Visually projects older shadow roots of the shadow host - ``img``: Displays an image + - ``div``: Neutral element for hooking styles in shadow trees + - ``span``: Neutral element for hooking styles in shadow trees - ``a``: Links to another Mojo application - ``title``: Briefly describes the current application state to the user - ``t``: Preserve whitespace (by default, whitespace nodes are dropped) + - ``error``: Represents a parse error ### Additional Elements ### diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index 36daa1c349..6cafa7199c 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -16,9 +16,9 @@ SKY MODULE - radio button and radio button group module.exports.RadioElement = module.registerElement({ tagName: 'radio', shadow: true, - prototype: class extends Element { - constructor () { - super(); + prototype: (class extends Element { + constructor (module) { + super(module); this.addEventListener('click', (event) => this.checked = true); this.shadowRoot.appendChild(module.document.findId('radio-shadow').content.cloneNode(true)); } @@ -42,7 +42,7 @@ SKY MODULE - radio button and radio button group if (this.parentNode instanceof module.exports.RadioGroupElement) this.parentNode.setChecked(this); } - }, + }).prototype, }); @@ -56,9 +56,9 @@ SKY MODULE - radio button and radio button group module.exports.RadioGroupElement = module.registerElement({ tagName: 'radiogroup', shadow: true, - prototype: class extends Element { - constructor () { - super(); + prototype: (class extends Element { + constructor (module) { + super(module); this.shadowRoot.appendChild(module.document.findId('radiogroup-shadow').content.cloneNode(true)); } get value () { @@ -85,6 +85,6 @@ SKY MODULE - radio button and radio button group if (child != radio) child.checked = false; } - }, + }).prototype, }); From a0a988fadf059349f9a4e8e7759957021baed771 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 4 Nov 2014 12:16:49 -0800 Subject: [PATCH 074/732] Specs: define registerElement() a little differently, so that the code that uses it looks nicer; this moves the complexity to places that register elements without using 'class' (e.g. the internals of frameworks that create elements for defining elements) Review URL: https://codereview.chromium.org/699083005 --- engine/src/flutter/examples/radio.sky | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index 6cafa7199c..b5b139bb73 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -16,7 +16,7 @@ SKY MODULE - radio button and radio button group module.exports.RadioElement = module.registerElement({ tagName: 'radio', shadow: true, - prototype: (class extends Element { + constructor: class extends Element { constructor (module) { super(module); this.addEventListener('click', (event) => this.checked = true); @@ -42,7 +42,7 @@ SKY MODULE - radio button and radio button group if (this.parentNode instanceof module.exports.RadioGroupElement) this.parentNode.setChecked(this); } - }).prototype, + }, }); @@ -53,10 +53,10 @@ SKY MODULE - radio button and radio button group From 0d3b8f4cc94bdba49a1b74a1c92757f9a4f52882 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 4 Nov 2014 13:32:07 -0800 Subject: [PATCH 075/732] Docs: add an example that uses the current APIs to define an element; an example that uses that example to define some HTMLy elements; and an example to use those HTMLy elements to display a hello world doc. Highly incomplete WIP. Review URL: https://codereview.chromium.org/698293003 --- .../examples/htmlish/framework/element.sky | 72 ++++++++++++ .../examples/htmlish/framework/htmlish.sky | 109 ++++++++++++++++++ .../examples/htmlish/samples/intro.sky | 11 ++ 3 files changed, 192 insertions(+) create mode 100644 engine/src/flutter/examples/htmlish/framework/element.sky create mode 100644 engine/src/flutter/examples/htmlish/framework/htmlish.sky create mode 100644 engine/src/flutter/examples/htmlish/samples/intro.sky diff --git a/engine/src/flutter/examples/htmlish/framework/element.sky b/engine/src/flutter/examples/htmlish/framework/element.sky new file mode 100644 index 0000000000..ab792677d4 --- /dev/null +++ b/engine/src/flutter/examples/htmlish/framework/element.sky @@ -0,0 +1,72 @@ +SKY MODULE - defines an element + + + + + diff --git a/engine/src/flutter/examples/htmlish/framework/htmlish.sky b/engine/src/flutter/examples/htmlish/framework/htmlish.sky new file mode 100644 index 0000000000..1baf62f5f0 --- /dev/null +++ b/engine/src/flutter/examples/htmlish/framework/htmlish.sky @@ -0,0 +1,109 @@ +SKY MODULE - exports some basic HTML-like elements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/flutter/examples/htmlish/samples/intro.sky b/engine/src/flutter/examples/htmlish/samples/intro.sky new file mode 100644 index 0000000000..c200e2d831 --- /dev/null +++ b/engine/src/flutter/examples/htmlish/samples/intro.sky @@ -0,0 +1,11 @@ +#!mojo mojo:sky + + + + Welcome to Sky + + +

Introduction

+

Hello world.

+ + From a4ed8ae0a8ffc8b4a782c3cb9302a20b38136794 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 4 Nov 2014 13:35:03 -0800 Subject: [PATCH 076/732] Add a microbenchmark for simple block layout R=eseidel@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/701813004 --- .../benchmarks/layout/simple-blocks.html | 44 +++++++++++++++++++ .../flutter/benchmarks/resources/runner.sky | 7 +++ 2 files changed, 51 insertions(+) create mode 100644 engine/src/flutter/benchmarks/layout/simple-blocks.html diff --git a/engine/src/flutter/benchmarks/layout/simple-blocks.html b/engine/src/flutter/benchmarks/layout/simple-blocks.html new file mode 100644 index 0000000000..094f763b10 --- /dev/null +++ b/engine/src/flutter/benchmarks/layout/simple-blocks.html @@ -0,0 +1,44 @@ + + + +
+ +
diff --git a/engine/src/flutter/benchmarks/resources/runner.sky b/engine/src/flutter/benchmarks/resources/runner.sky index eaa1059e07..e307c0d273 100644 --- a/engine/src/flutter/benchmarks/resources/runner.sky +++ b/engine/src/flutter/benchmarks/resources/runner.sky @@ -3,6 +3,7 @@ function PerfRunner(options) { this.unit_ = options.unit || "ms"; this.iterationsRemaining_ = options.iterations || 10; this.results_ = []; + this.setup_ = options.setup; } PerfRunner.prototype.log = function(line) { @@ -17,9 +18,15 @@ PerfRunner.prototype.recordResult = function(result) { PerfRunner.prototype.runAsync = function(test) { var self = this; window.setTimeout(function() { + if (self.setup_) { + var setup = self.setup_; + setup(); + } + var startTime = Date.now(); test(function() { var endTime = Date.now(); + self.recordResult(endTime - startTime); if (--self.iterationsRemaining_ > 0) self.runAsync(test); From f9981b1300a814d425c759419939d096a3f3a289 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 4 Nov 2014 14:15:40 -0800 Subject: [PATCH 077/732] Docs: We renamed appendChild to append, so update this example which still uses the old name. Review URL: https://codereview.chromium.org/685063006 --- engine/src/flutter/examples/radio.sky | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/examples/radio.sky b/engine/src/flutter/examples/radio.sky index b5b139bb73..cb39cdb0d7 100644 --- a/engine/src/flutter/examples/radio.sky +++ b/engine/src/flutter/examples/radio.sky @@ -20,7 +20,7 @@ SKY MODULE - radio button and radio button group constructor (module) { super(module); this.addEventListener('click', (event) => this.checked = true); - this.shadowRoot.appendChild(module.document.findId('radio-shadow').content.cloneNode(true)); + this.shadowRoot.append(module.document.findId('radio-shadow').content.cloneNode(true)); } get checked () { return this.hasAttribute('checked'); @@ -59,7 +59,7 @@ SKY MODULE - radio button and radio button group constructor: (class extends Element { constructor (module) { super(module); - this.shadowRoot.appendChild(module.document.findId('radiogroup-shadow').content.cloneNode(true)); + this.shadowRoot.append(module.document.findId('radiogroup-shadow').content.cloneNode(true)); } get value () { let children = this.getChildNodes(); From 79fb5e2c4824e36255b0c3722a76bf0dce44c1e5 Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Tue, 4 Nov 2014 15:21:57 -0800 Subject: [PATCH 078/732] fix file-browser R=eseidel@chromium.org, abarth BUG= Review URL: https://codereview.chromium.org/705683002 --- engine/src/flutter/examples/file-browser.sky | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/examples/file-browser.sky b/engine/src/flutter/examples/file-browser.sky index 43c1267b30..ba456ae9e3 100644 --- a/engine/src/flutter/examples/file-browser.sky +++ b/engine/src/flutter/examples/file-browser.sky @@ -13,11 +13,11 @@ } File browser for {{ url }} -