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

Side by Side Diff: headless/lib/embedder_mojo_browsertest.cc

Issue 2571903003: Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: remove the changes to web_ui_mojo.js which seemed to cause flakiness. Created 3 years, 12 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 | « extensions/test/data/api_test_base_unittest.js ('k') | headless/test/data/page_one.html » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 #include "base/optional.h" 6 #include "base/optional.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 class MojoBindingsTest : public EmbedderMojoTest { 146 class MojoBindingsTest : public EmbedderMojoTest {
147 public: 147 public:
148 void RunMojoTest() override { 148 void RunMojoTest() override {
149 devtools_client_->GetRuntime()->Evaluate( 149 devtools_client_->GetRuntime()->Evaluate(
150 "// Note define() defines a module in the mojo module dependency \n" 150 "// Note define() defines a module in the mojo module dependency \n"
151 "// system. While we don't expose our module, the callback below only\n" 151 "// system. While we don't expose our module, the callback below only\n"
152 "// fires after the requested modules have been loaded. \n" 152 "// fires after the requested modules have been loaded. \n"
153 "define([ \n" 153 "define([ \n"
154 " 'headless/lib/embedder_test.mojom', \n" 154 " 'headless/lib/embedder_test.mojom', \n"
155 " 'mojo/public/js/core', \n"
156 " 'mojo/public/js/router', \n"
157 " 'content/public/renderer/frame_interfaces', \n" 155 " 'content/public/renderer/frame_interfaces', \n"
158 " ], function(embedderMojom, mojoCore, routerModule, \n" 156 " ], function(embedderMojom, frameInterfaces) { \n"
159 " frameInterfaces) { \n"
160 " var testEmbedderService = \n" 157 " var testEmbedderService = \n"
161 " new embedderMojom.TestEmbedderService.proxyClass( \n" 158 " new embedderMojom.TestEmbedderServicePtr( \n"
162 " new routerModule.Router( \n" 159 " frameInterfaces.getInterface( \n"
163 " frameInterfaces.getInterface( \n" 160 " embedderMojom.TestEmbedderService.name)); \n"
164 " embedderMojom.TestEmbedderService.name))); \n"
165 " \n" 161 " \n"
166 " // Send a message to the embedder! \n" 162 " // Send a message to the embedder! \n"
167 " testEmbedderService.returnTestResult('hello world'); \n" 163 " testEmbedderService.returnTestResult('hello world'); \n"
168 "});", 164 "});",
169 base::Bind(&EmbedderMojoTest::OnEvalResult, base::Unretained(this))); 165 base::Bind(&EmbedderMojoTest::OnEvalResult, base::Unretained(this)));
170 } 166 }
171 167
172 // embedder_test::TestEmbedderService: 168 // embedder_test::TestEmbedderService:
173 void ReturnTestResult(const std::string& result) override { 169 void ReturnTestResult(const std::string& result) override {
174 EXPECT_EQ("hello world", result); 170 EXPECT_EQ("hello world", result);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void OnLoadingFailed(const network::LoadingFailedParams& params) override { 242 void OnLoadingFailed(const network::LoadingFailedParams& params) override {
247 // The navigation should fail since HTTP requests are blackholed. 243 // The navigation should fail since HTTP requests are blackholed.
248 EXPECT_EQ(params.GetErrorText(), "net::ERR_FILE_NOT_FOUND"); 244 EXPECT_EQ(params.GetErrorText(), "net::ERR_FILE_NOT_FOUND");
249 FinishAsynchronousTest(); 245 FinishAsynchronousTest();
250 } 246 }
251 }; 247 };
252 248
253 DEVTOOLS_CLIENT_TEST_F(HttpDisabledByDefaultWhenMojoBindingsUsed); 249 DEVTOOLS_CLIENT_TEST_F(HttpDisabledByDefaultWhenMojoBindingsUsed);
254 250
255 } // namespace headless 251 } // namespace headless
OLDNEW
« no previous file with comments | « extensions/test/data/api_test_base_unittest.js ('k') | headless/test/data/page_one.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698