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

Side by Side Diff: extensions/renderer/api_test_base.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 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/renderer/api_test_base.h ('k') | extensions/shell/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 "extensions/renderer/api_test_base.h" 5 #include "extensions/renderer/api_test_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "extensions/common/extension_urls.h" 11 #include "extensions/common/extension_urls.h"
12 #include "extensions/renderer/dispatcher.h" 12 #include "extensions/renderer/dispatcher.h"
13 #include "extensions/renderer/process_info_native_handler.h" 13 #include "extensions/renderer/process_info_native_handler.h"
14 #include "gin/converter.h" 14 #include "gin/converter.h"
15 #include "gin/dictionary.h" 15 #include "gin/dictionary.h"
16 #include "mojo/edk/js/core.h"
17 #include "mojo/edk/js/handle.h"
18 #include "mojo/edk/js/support.h"
16 #include "mojo/public/cpp/bindings/interface_request.h" 19 #include "mojo/public/cpp/bindings/interface_request.h"
17 #include "mojo/public/cpp/system/core.h" 20 #include "mojo/public/cpp/system/core.h"
18 #include "third_party/mojo/src/mojo/edk/js/core.h"
19 #include "third_party/mojo/src/mojo/edk/js/handle.h"
20 #include "third_party/mojo/src/mojo/edk/js/support.h"
21 21
22 namespace extensions { 22 namespace extensions {
23 namespace { 23 namespace {
24 24
25 // Natives for the implementation of the unit test version of chrome.test. Calls 25 // Natives for the implementation of the unit test version of chrome.test. Calls
26 // the provided |quit_closure| when either notifyPass or notifyFail is called. 26 // the provided |quit_closure| when either notifyPass or notifyFail is called.
27 class TestNatives : public gin::Wrappable<TestNatives> { 27 class TestNatives : public gin::Wrappable<TestNatives> {
28 public: 28 public:
29 static gin::Handle<TestNatives> Create(v8::Isolate* isolate, 29 static gin::Handle<TestNatives> Create(v8::Isolate* isolate,
30 const base::Closure& quit_closure) { 30 const base::Closure& quit_closure) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 env()->OverrideNativeHandler( 149 env()->OverrideNativeHandler(
150 "event_natives", 150 "event_natives",
151 "exports.$set('AttachEvent', function() {});" 151 "exports.$set('AttachEvent', function() {});"
152 "exports.$set('DetachEvent', function() {});" 152 "exports.$set('DetachEvent', function() {});"
153 "exports.$set('AttachFilteredEvent', function() {});" 153 "exports.$set('AttachFilteredEvent', function() {});"
154 "exports.$set('AttachFilteredEvent', function() {});" 154 "exports.$set('AttachFilteredEvent', function() {});"
155 "exports.$set('MatchAgainstEventFilter', function() { return [] });"); 155 "exports.$set('MatchAgainstEventFilter', function() { return [] });");
156 156
157 gin::ModuleRegistry::From(env()->context()->v8_context()) 157 gin::ModuleRegistry::From(env()->context()->v8_context())
158 ->AddBuiltinModule(env()->isolate(), 158 ->AddBuiltinModule(env()->isolate(),
159 mojo::js::Core::kModuleName, 159 mojo::edk::Core::kModuleName,
160 mojo::js::Core::GetModule(env()->isolate())); 160 mojo::edk::Core::GetModule(env()->isolate()));
161 gin::ModuleRegistry::From(env()->context()->v8_context()) 161 gin::ModuleRegistry::From(env()->context()->v8_context())
162 ->AddBuiltinModule(env()->isolate(), 162 ->AddBuiltinModule(env()->isolate(),
163 mojo::js::Support::kModuleName, 163 mojo::edk::Support::kModuleName,
164 mojo::js::Support::GetModule(env()->isolate())); 164 mojo::edk::Support::GetModule(env()->isolate()));
165 gin::Handle<TestServiceProvider> service_provider = 165 gin::Handle<TestServiceProvider> service_provider =
166 TestServiceProvider::Create(env()->isolate()); 166 TestServiceProvider::Create(env()->isolate());
167 service_provider_ = service_provider.get(); 167 service_provider_ = service_provider.get();
168 gin::ModuleRegistry::From(env()->context()->v8_context()) 168 gin::ModuleRegistry::From(env()->context()->v8_context())
169 ->AddBuiltinModule(env()->isolate(), 169 ->AddBuiltinModule(env()->isolate(),
170 "content/public/renderer/service_provider", 170 "content/public/renderer/service_provider",
171 service_provider.ToV8()); 171 service_provider.ToV8());
172 } 172 }
173 173
174 void ApiTestEnvironment::InitializeEnvironment() { 174 void ApiTestEnvironment::InitializeEnvironment() {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 test_env_.reset(new ApiTestEnvironment(env())); 233 test_env_.reset(new ApiTestEnvironment(env()));
234 } 234 }
235 235
236 void ApiTestBase::RunTest(const std::string& file_name, 236 void ApiTestBase::RunTest(const std::string& file_name,
237 const std::string& test_name) { 237 const std::string& test_name) {
238 ExpectNoAssertionsMade(); 238 ExpectNoAssertionsMade();
239 test_env_->RunTest(file_name, test_name); 239 test_env_->RunTest(file_name, test_name);
240 } 240 }
241 241
242 } // namespace extensions 242 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_test_base.h ('k') | extensions/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698