OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains the definition for LayoutTestController. | 5 // This file contains the definition for LayoutTestController. |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "webkit/tools/test_shell/layout_test_controller.h" | 9 #include "webkit/tools/test_shell/layout_test_controller.h" |
10 | 10 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 private: | 345 private: |
346 string script_; | 346 string script_; |
347 }; | 347 }; |
348 | 348 |
349 class WorkItemIsolatedWorldScript : public LayoutTestController::WorkItem { | 349 class WorkItemIsolatedWorldScript : public LayoutTestController::WorkItem { |
350 public: | 350 public: |
351 WorkItemIsolatedWorldScript(const string& script) : script_(script) {} | 351 WorkItemIsolatedWorldScript(const string& script) : script_(script) {} |
352 bool Run(TestShell* shell) { | 352 bool Run(TestShell* shell) { |
353 WebScriptSource source(WebString::fromUTF8(script_)); | 353 WebScriptSource source(WebString::fromUTF8(script_)); |
354 shell->webView()->GetMainFrame()->ExecuteScriptInNewWorld(&source, 1); | 354 shell->webView()->GetMainFrame()->ExecuteScriptInNewWorld(&source, 1, 0); |
355 return false; | 355 return false; |
356 } | 356 } |
357 private: | 357 private: |
358 string script_; | 358 string script_; |
359 }; | 359 }; |
360 | 360 |
361 void LayoutTestController::queueLoadingScript( | 361 void LayoutTestController::queueLoadingScript( |
362 const CppArgumentList& args, CppVariant* result) { | 362 const CppArgumentList& args, CppVariant* result) { |
363 if (args.size() > 0 && args[0].isString()) | 363 if (args.size() > 0 && args[0].isString()) |
364 work_queue_.AddWork(new WorkItemLoadingScript(args[0].ToString())); | 364 work_queue_.AddWork(new WorkItemLoadingScript(args[0].ToString())); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 void LayoutTestController::fallbackMethod( | 794 void LayoutTestController::fallbackMethod( |
795 const CppArgumentList& args, CppVariant* result) { | 795 const CppArgumentList& args, CppVariant* result) { |
796 std::wstring message(L"JavaScript ERROR: unknown method called on LayoutTestCo
ntroller"); | 796 std::wstring message(L"JavaScript ERROR: unknown method called on LayoutTestCo
ntroller"); |
797 if (!shell_->layout_test_mode()) { | 797 if (!shell_->layout_test_mode()) { |
798 logging::LogMessage("CONSOLE:", 0).stream() << message; | 798 logging::LogMessage("CONSOLE:", 0).stream() << message; |
799 } else { | 799 } else { |
800 printf("CONSOLE MESSAGE: %S\n", message.c_str()); | 800 printf("CONSOLE MESSAGE: %S\n", message.c_str()); |
801 } | 801 } |
802 result->SetNull(); | 802 result->SetNull(); |
803 } | 803 } |
OLD | NEW |