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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 private: | 143 private: |
144 base::RunLoop* run_loop_; | 144 base::RunLoop* run_loop_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(TestWebUIControllerFactory); | 146 DISALLOW_COPY_AND_ASSIGN(TestWebUIControllerFactory); |
147 }; | 147 }; |
148 | 148 |
149 class WebUIMojoTest : public ContentBrowserTest { | 149 class WebUIMojoTest : public ContentBrowserTest { |
150 public: | 150 public: |
151 WebUIMojoTest() { | 151 WebUIMojoTest() { |
152 MojoChannelInit::InitMojo(); | |
153 WebUIControllerFactory::RegisterFactory(&factory_); | 152 WebUIControllerFactory::RegisterFactory(&factory_); |
154 } | 153 } |
155 | 154 |
156 virtual ~WebUIMojoTest() { | 155 virtual ~WebUIMojoTest() { |
157 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); | 156 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); |
158 } | 157 } |
159 | 158 |
160 TestWebUIControllerFactory* factory() { return &factory_; } | 159 TestWebUIControllerFactory* factory() { return &factory_; } |
161 | 160 |
162 private: | 161 private: |
(...skipping 23 matching lines...) Expand all Loading... |
186 factory()->set_run_loop(&run_loop); | 185 factory()->set_run_loop(&run_loop); |
187 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html")); | 186 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html")); |
188 NavigateToURL(shell(), test_url); | 187 NavigateToURL(shell(), test_url); |
189 // RunLoop is quit when message received from page. | 188 // RunLoop is quit when message received from page. |
190 run_loop.Run(); | 189 run_loop.Run(); |
191 EXPECT_TRUE(got_message); | 190 EXPECT_TRUE(got_message); |
192 } | 191 } |
193 | 192 |
194 } // namespace | 193 } // namespace |
195 } // namespace content | 194 } // namespace content |
OLD | NEW |