| Index: content/shell/test_runner/test_runner.cc
|
| diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc
|
| index 9763472d529cb9c09848472b1dbf58f8eb30f32e..e74103eb95dc363bd3659abbc3e7a87070004cd4 100644
|
| --- a/content/shell/test_runner/test_runner.cc
|
| +++ b/content/shell/test_runner/test_runner.cc
|
| @@ -5,6 +5,8 @@
|
| #include "content/shell/test_runner/test_runner.h"
|
|
|
| #include <stddef.h>
|
| +
|
| +#include <algorithm>
|
| #include <limits>
|
| #include <utility>
|
|
|
| @@ -1999,7 +2001,7 @@ void TestRunner::ShowDevTools(const std::string& settings,
|
|
|
| class WorkItemBackForward : public TestRunner::WorkItem {
|
| public:
|
| - WorkItemBackForward(int distance) : distance_(distance) {}
|
| + explicit WorkItemBackForward(int distance) : distance_(distance) {}
|
|
|
| bool Run(WebTestDelegate* delegate, WebView*) override {
|
| delegate->GoToOffset(distance_);
|
| @@ -2037,7 +2039,7 @@ void TestRunner::QueueReload() {
|
|
|
| class WorkItemLoadingScript : public TestRunner::WorkItem {
|
| public:
|
| - WorkItemLoadingScript(const std::string& script) : script_(script) {}
|
| + explicit WorkItemLoadingScript(const std::string& script) : script_(script) {}
|
|
|
| bool Run(WebTestDelegate*, WebView* web_view) override {
|
| blink::WebFrame* main_frame = web_view->MainFrame();
|
| @@ -2061,7 +2063,8 @@ void TestRunner::QueueLoadingScript(const std::string& script) {
|
|
|
| class WorkItemNonLoadingScript : public TestRunner::WorkItem {
|
| public:
|
| - WorkItemNonLoadingScript(const std::string& script) : script_(script) {}
|
| + explicit WorkItemNonLoadingScript(const std::string& script)
|
| + : script_(script) {}
|
|
|
| bool Run(WebTestDelegate*, WebView* web_view) override {
|
| blink::WebFrame* main_frame = web_view->MainFrame();
|
| @@ -2103,7 +2106,11 @@ void TestRunner::QueueLoad(const std::string& url, const std::string& target) {
|
| return;
|
|
|
| // FIXME: Implement WebURL::resolve() and avoid GURL.
|
| - GURL current_url = main_view_->MainFrame()->GetDocument().Url();
|
| + CHECK(main_view_->MainFrame()->IsWebLocalFrame())
|
| + << "This function cannot be called if the main frame is not "
|
| + "a local frame.";
|
| + GURL current_url =
|
| + main_view_->MainFrame()->ToWebLocalFrame()->GetDocument().Url();
|
| GURL full_url = current_url.Resolve(url);
|
| work_queue_.AddWork(new WorkItemLoad(full_url, target));
|
| }
|
|
|