diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 06:02:07 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 06:02:07 +0000 |
commit | 6d3744980e419303b01f12fe6c82ff81cfc2fd2f (patch) | |
tree | 3ad6ece5678bf4cf53fb04d232dfb779ccf4b89f /chrome/test/data/layout_tests | |
parent | aded0071867946f9aab08ce88ebbfd83c77c83af (diff) | |
download | chromium_src-6d3744980e419303b01f12fe6c82ff81cfc2fd2f.zip chromium_src-6d3744980e419303b01f12fe6c82ff81cfc2fd2f.tar.gz chromium_src-6d3744980e419303b01f12fe6c82ff81cfc2fd2f.tar.bz2 |
Run the DOM Storage layout tests in the UI test framework since the test shell doesn't hit very much of the new code. I still plan to write unit tests and we're still goign to enable the layout tests in test shell, but this is still a good way for us to test the full stack ASAP.
Workers has used this technique for a while now. This CL factors out the layout test running code from the workers ui test and moves arounds directories a bit so not everything is in the "workers" directory.
Doing this via a v8 extension is the right way to go long term, but I ran into a couple snags, so I think this is a good first step.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/159720
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/layout_tests')
-rw-r--r-- | chrome/test/data/layout_tests/layout_test_controller.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/test/data/layout_tests/layout_test_controller.html b/chrome/test/data/layout_tests/layout_test_controller.html new file mode 100644 index 0000000..5e14a39 --- /dev/null +++ b/chrome/test/data/layout_tests/layout_test_controller.html @@ -0,0 +1,26 @@ +<script> +function LayoutTestController() { + this.wait_until_done_ = false; + this.dumpAsText = function () { }; + this.waitUntilDone = function () { + this.wait_until_done_ = true; + }; + this.notifyDone = function () { + var cookie = "%COOKIE%=" + encodeURIComponent(document.firstChild.innerText); + document.cookie = cookie; + }; + this.OnTimerEvent = function () { + // Some layout tests do not call waitUntilDone. If this is true, we should + // assume the test is done when it's finished loading. + if (!this.wait_until_done_) + layoutTestController.notifyDone(); + }; + this.OnLoadEvent = function (event) { + // Do a timeout to ensure that we run after all other onload handlers have + // finished. + setTimeout(layoutTestController.OnTimerEvent, 0); + }; +} +window.layoutTestController = new LayoutTestController(); +window.addEventListener('load', layoutTestController.OnLoadEvent, false); +</script> |