| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <limits> | 5 #include <limits> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 : WebUIController(web_ui), run_loop_(run_loop) { | 97 : WebUIController(web_ui), run_loop_(run_loop) { |
| 98 content::WebUIDataSource* data_source = | 98 content::WebUIDataSource* data_source = |
| 99 WebUIDataSource::Create("mojo-web-ui"); | 99 WebUIDataSource::Create("mojo-web-ui"); |
| 100 data_source->SetRequestFilter(base::Bind(&GetResource)); | 100 data_source->SetRequestFilter(base::Bind(&GetResource)); |
| 101 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 101 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
| 102 data_source); | 102 data_source); |
| 103 } | 103 } |
| 104 | 104 |
| 105 protected: | 105 protected: |
| 106 base::RunLoop* run_loop_; | 106 base::RunLoop* run_loop_; |
| 107 scoped_ptr<BrowserTargetImpl> browser_target_; | 107 std::unique_ptr<BrowserTargetImpl> browser_target_; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 DISALLOW_COPY_AND_ASSIGN(TestWebUIController); | 110 DISALLOW_COPY_AND_ASSIGN(TestWebUIController); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // TestWebUIController that additionally creates the ping test BrowserTarget | 113 // TestWebUIController that additionally creates the ping test BrowserTarget |
| 114 // implementation at the right time. | 114 // implementation at the right time. |
| 115 class PingTestWebUIController : public TestWebUIController { | 115 class PingTestWebUIController : public TestWebUIController { |
| 116 public: | 116 public: |
| 117 PingTestWebUIController(WebUI* web_ui, base::RunLoop* run_loop) | 117 PingTestWebUIController(WebUI* web_ui, base::RunLoop* run_loop) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 GURL("chrome://mojo-web-ui/web_ui_mojo_shell_test.html")); | 240 GURL("chrome://mojo-web-ui/web_ui_mojo_shell_test.html")); |
| 241 | 241 |
| 242 DOMMessageQueue message_queue; | 242 DOMMessageQueue message_queue; |
| 243 std::string message; | 243 std::string message; |
| 244 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 244 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| 245 EXPECT_EQ("true", message); | 245 EXPECT_EQ("true", message); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace | 248 } // namespace |
| 249 } // namespace content | 249 } // namespace content |
| OLD | NEW |