diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-30 18:09:48 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-30 18:09:48 +0000 |
commit | 376bc0c68d0eef158d872dc16741fae048ffb223 (patch) | |
tree | a4d3e061738a519387007b9450ef525a717a5727 | |
parent | 8ac68283bbf58ad85ab929148a33aad8c46230fb (diff) | |
download | chromium_src-376bc0c68d0eef158d872dc16741fae048ffb223.zip chromium_src-376bc0c68d0eef158d872dc16741fae048ffb223.tar.gz chromium_src-376bc0c68d0eef158d872dc16741fae048ffb223.tar.bz2 |
Implement LayoutTestController::numberOfActiveAnimations to get a
few Layout tests passing.
Review URL: http://codereview.chromium.org/19490
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8968 0039d316-1c4b-4281-b951-d872f2087c98
8 files changed, 39 insertions, 5 deletions
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.checksum b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.checksum new file mode 100644 index 0000000..88e3509 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.checksum @@ -0,0 +1 @@ +ac7d6c1506de4b83f29a5b8cc322ccf8
\ No newline at end of file diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.png b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.png Binary files differnew file mode 100644 index 0000000..cbb17b7 --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.png diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.txt new file mode 100644 index 0000000..02b5d7e --- /dev/null +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/animations/animation-drt-api-expected.txt @@ -0,0 +1,11 @@ +layer at (0,0) size 800x600 + RenderView at (0,0) size 800x600 +layer at (0,0) size 800x316 + RenderBlock {HTML} at (0,0) size 800x316 + RenderBody {BODY} at (0,21) size 800x295 + RenderBlock {H1} at (0,0) size 800x74 + RenderText {#text} at (0,0) size 799x73 + text run at (0,0) width 799: "Test for DRT pauseAnimationAtTimeOnElementWithId()" + text run at (0,37) width 54: "API" +layer at (150,116) size 200x200 + RenderBlock (relative positioned) {DIV} at (0,95) size 200x200 [bgcolor=#FF0000] diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index 6fc79b9..d972263 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -860,4 +860,17 @@ bool ElementDoesAutoCompleteForElementWithId(WebView* view, return input_element->autoComplete(); } +int NumberOfActiveAnimations(WebView* view) { + WebFrame* web_frame = view->GetMainFrame(); + if (!web_frame) + return -1; + + WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame(); + WebCore::AnimationController* controller = frame->animation(); + if (!controller) + return -1; + + return controller->numberOfActiveAnimations(); +} + } // webkit_glue diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h index 9c88e86..61af34e 100644 --- a/webkit/glue/dom_operations.h +++ b/webkit/glue/dom_operations.h @@ -192,6 +192,8 @@ bool PauseTransitionAtTimeOnElementWithId(WebView* view, bool ElementDoesAutoCompleteForElementWithId(WebView* view, const std::string& element_id); +// Returns the number of animations currently running. +int NumberOfActiveAnimations(WebView* view); } // namespace webkit_glue diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 3591f88..1a6a797 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -1055,7 +1055,7 @@ LayoutTests/security/block-test.html = FAIL // MERGE 38500:39550: New tests // Missing expected results -SKIP : LayoutTests/animations/animation-drt-api.html = PASS +SKIP LINUX MAC : LayoutTests/animations/animation-drt-api.html = PASS // MERGE 38600:38625: New tests // Big 4999: we need to fix this same bug in our plugin handling Apple did in @@ -1640,9 +1640,8 @@ SKIP : LayoutTests/fast/events/pointer-events-2.html = FAIL SKIP : LayoutTests/fast/events/pointer-events.html = FAIL // Merge 39660:39711 - need to implement layoutTestController.numberOfActiveAnimations() -SKIP : LayoutTests/animations/animation-controller-drt-api.html = TIMEOUT -SKIP : LayoutTests/transitions/zero-duration-with-non-zero-delay-end.html = TIMEOUT - +SKIP LINUX MAC : LayoutTests/animations/animation-controller-drt-api.html = TIMEOUT +SKIP LINUX MAC : LayoutTests/transitions/zero-duration-with-non-zero-delay-end.html = TIMEOUT // Merge 39744:39829 - new tests WIN LINUX : LayoutTests/fast/canvas/canvas-incremental-repaint-2.html = FAIL @@ -1733,7 +1732,7 @@ MAC : LayoutTests/fast/forms/002.html = FAIL // Merge 40086:40124 -- new test // This needs layoutTestController.numberOfActiveAnimations implemented. -LayoutTests/transitions/repeated-firing-background-color.html = FAIL TIMEOUT +LINUX MAC : LayoutTests/transitions/repeated-firing-background-color.html = FAIL TIMEOUT // Merge 40124:40164 -- regressions // This test tries to remove an iframe on the page then generate the pixel diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 3fa9a06..45c5a38 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -101,6 +101,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) { BindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId); BindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId); BindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); + BindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); // The following are stubs. BindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive); @@ -617,6 +618,11 @@ void LayoutTestController::elementDoesAutoCompleteForElementWithId( shell_->webView(), element_id)); } +void LayoutTestController::numberOfActiveAnimations(const CppArgumentList& args, + CppVariant* result) { + result->Set(webkit_glue::NumberOfActiveAnimations(shell_->webView())); +} + // // Unimplemented stubs // diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 5155c3e..1be0e59 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -139,6 +139,8 @@ class LayoutTestController : public CppBoundClass { CppVariant* result); void elementDoesAutoCompleteForElementWithId(const CppArgumentList& args, CppVariant* result); + void numberOfActiveAnimations(const CppArgumentList& args, + CppVariant* result); // The following are only stubs. TODO(pamg): Implement any of these that // are needed to pass the layout tests. |