diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 06:42:09 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 06:42:09 +0000 |
commit | c295d94025ee10f64cbf2d12ca29f4ae23f28e3e (patch) | |
tree | 1179f627d22930423b1daa9c16661d0c443dc962 /webkit/tools/test_shell/layout_test_controller.cc | |
parent | 6d3744980e419303b01f12fe6c82ff81cfc2fd2f (diff) | |
download | chromium_src-c295d94025ee10f64cbf2d12ca29f4ae23f28e3e.zip chromium_src-c295d94025ee10f64cbf2d12ca29f4ae23f28e3e.tar.gz chromium_src-c295d94025ee10f64cbf2d12ca29f4ae23f28e3e.tar.bz2 |
Don't use work_queue_ for the isolated world scripts. Instead, we just
evaluate the script directly.
This change will break the isolatedWorld tests until I land the change to
rename the layoutTestController method upstream.
R=darin
TEST=Coverged by LayoutTests.
Review URL: http://codereview.chromium.org/159782
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/layout_test_controller.cc')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index af9884e..ba0382e 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -136,7 +136,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) { BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); - BindMethod("queueScriptInIsolatedWorld", &LayoutTestController::queueScriptInIsolatedWorld); + BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); // The fallback method is called when an unknown method is invoked. BindFallbackMethod(&LayoutTestController::fallbackMethod); @@ -348,18 +348,6 @@ class WorkItemNonLoadingScript : public LayoutTestController::WorkItem { string script_; }; -class WorkItemIsolatedWorldScript : public LayoutTestController::WorkItem { - public: - WorkItemIsolatedWorldScript(const string& script) : script_(script) {} - bool Run(TestShell* shell) { - WebScriptSource source(WebString::fromUTF8(script_)); - shell->webView()->GetMainFrame()->ExecuteScriptInNewWorld(&source, 1, 0); - return false; - } - private: - string script_; -}; - void LayoutTestController::queueLoadingScript( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isString()) @@ -801,10 +789,12 @@ void LayoutTestController::setXSSAuditorEnabled( result->SetNull(); } -void LayoutTestController::queueScriptInIsolatedWorld( +void LayoutTestController::evaluateScriptInIsolatedWorld( const CppArgumentList& args, CppVariant* result) { - if (args.size() > 0 && args[0].isString()) - work_queue_.AddWork(new WorkItemIsolatedWorldScript(args[0].ToString())); + if (args.size() > 0 && args[0].isString()) { + WebScriptSource source(WebString::fromUTF8(args[0].ToString())); + shell_->webView()->GetMainFrame()->ExecuteScriptInNewWorld(&source, 1, 1); + } result->SetNull(); } |