Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 159542: Add a WebKit API that registers a V8 extension to be loaded into content (Closed)
Patch Set: final Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698