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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 if (args.size() > 0 && args[0].isString()) | 367 if (args.size() > 0 && args[0].isString()) |
368 work_queue_.AddWork(new WorkItemNonLoadingScript(args[0].ToString())); | 368 work_queue_.AddWork(new WorkItemNonLoadingScript(args[0].ToString())); |
369 result->SetNull(); | 369 result->SetNull(); |
370 } | 370 } |
371 | 371 |
372 class WorkItemLoad : public LayoutTestController::WorkItem { | 372 class WorkItemLoad : public LayoutTestController::WorkItem { |
373 public: | 373 public: |
374 WorkItemLoad(const GURL& url, const string& target) | 374 WorkItemLoad(const GURL& url, const string& target) |
375 : url_(url), target_(target) {} | 375 : url_(url), target_(target) {} |
376 bool Run(TestShell* shell) { | 376 bool Run(TestShell* shell) { |
377 shell->LoadURLForFrame(UTF8ToWide(url_.spec()).c_str(), | 377 shell->LoadURLForFrame(url_, UTF8ToWide(target_).c_str()); |
378 UTF8ToWide(target_).c_str()); | |
379 return true; // TODO(darin): Did it really start a navigation? | 378 return true; // TODO(darin): Did it really start a navigation? |
380 } | 379 } |
381 private: | 380 private: |
382 GURL url_; | 381 GURL url_; |
383 string target_; | 382 string target_; |
384 }; | 383 }; |
385 | 384 |
386 void LayoutTestController::queueLoad( | 385 void LayoutTestController::queueLoad( |
387 const CppArgumentList& args, CppVariant* result) { | 386 const CppArgumentList& args, CppVariant* result) { |
388 if (args.size() > 0 && args[0].isString()) { | 387 if (args.size() > 0 && args[0].isString()) { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 956 |
958 WebKit::WebURL url(GURL(args[0].ToString())); | 957 WebKit::WebURL url(GURL(args[0].ToString())); |
959 if (!url.isValid()) | 958 if (!url.isValid()) |
960 return; | 959 return; |
961 | 960 |
962 WebKit::whiteListAccessFromOrigin(url, | 961 WebKit::whiteListAccessFromOrigin(url, |
963 WebString::fromUTF8(args[1].ToString()), | 962 WebString::fromUTF8(args[1].ToString()), |
964 WebString::fromUTF8(args[2].ToString()), | 963 WebString::fromUTF8(args[2].ToString()), |
965 args[3].ToBoolean()); | 964 args[3].ToBoolean()); |
966 } | 965 } |
OLD | NEW |