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

Side by Side Diff: content/browser/webui/web_ui_mojo_browsertest.cc

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: fixes webui tests Created 3 years, 9 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 | « chrome/browser/pdf/pdf_extension_test.cc ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/files/file_path.h" 9 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
12 #include "base/memory/ref_counted_memory.h" 13 #include "base/memory/ref_counted_memory.h"
13 #include "base/path_service.h" 14 #include "base/path_service.h"
14 #include "base/run_loop.h" 15 #include "base/run_loop.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
17 #include "content/browser/webui/web_ui_controller_factory_registry.h" 18 #include "content/browser/webui/web_ui_controller_factory_registry.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 class WebUIMojoTest : public ContentBrowserTest { 179 class WebUIMojoTest : public ContentBrowserTest {
179 public: 180 public:
180 WebUIMojoTest() { 181 WebUIMojoTest() {
181 WebUIControllerFactory::RegisterFactory(&factory_); 182 WebUIControllerFactory::RegisterFactory(&factory_);
182 } 183 }
183 184
184 ~WebUIMojoTest() override { 185 ~WebUIMojoTest() override {
185 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); 186 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_);
186 } 187 }
187 188
189 // ContentBrowserTest overrides.
190 void SetUpCommandLine(base::CommandLine* command_line) override {
191 ContentBrowserTest::SetUpCommandLine(command_line);
192 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, "MojoJS");
193 }
194
188 TestWebUIControllerFactory* factory() { return &factory_; } 195 TestWebUIControllerFactory* factory() { return &factory_; }
189 196
190 private: 197 private:
191 TestWebUIControllerFactory factory_; 198 TestWebUIControllerFactory factory_;
192 199
193 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); 200 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest);
194 }; 201 };
195 202
196 bool IsGeneratedResourceAvailable(const std::string& resource_path) { 203 bool IsGeneratedResourceAvailable(const std::string& resource_path) {
197 // Currently there is no way to have a generated file included in the isolate 204 // Currently there is no way to have a generated file included in the isolate
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 NavigateToURL(other_shell, test_url); 239 NavigateToURL(other_shell, test_url);
233 // RunLoop is quit when message received from page. 240 // RunLoop is quit when message received from page.
234 other_run_loop.Run(); 241 other_run_loop.Run();
235 EXPECT_TRUE(g_got_message); 242 EXPECT_TRUE(g_got_message);
236 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), 243 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(),
237 other_shell->web_contents()->GetRenderProcessHost()); 244 other_shell->web_contents()->GetRenderProcessHost());
238 } 245 }
239 246
240 } // namespace 247 } // namespace
241 } // namespace content 248 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/pdf/pdf_extension_test.cc ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698