| 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 "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" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ->AddBuiltinModule(env()->isolate(), mojo::edk::js::Core::kModuleName, | 158 ->AddBuiltinModule(env()->isolate(), mojo::edk::js::Core::kModuleName, |
| 159 mojo::edk::js::Core::GetModule(env()->isolate())); | 159 mojo::edk::js::Core::GetModule(env()->isolate())); |
| 160 gin::ModuleRegistry::From(env()->context()->v8_context()) | 160 gin::ModuleRegistry::From(env()->context()->v8_context()) |
| 161 ->AddBuiltinModule(env()->isolate(), mojo::edk::js::Support::kModuleName, | 161 ->AddBuiltinModule(env()->isolate(), mojo::edk::js::Support::kModuleName, |
| 162 mojo::edk::js::Support::GetModule(env()->isolate())); | 162 mojo::edk::js::Support::GetModule(env()->isolate())); |
| 163 gin::Handle<TestServiceProvider> service_provider = | 163 gin::Handle<TestServiceProvider> service_provider = |
| 164 TestServiceProvider::Create(env()->isolate()); | 164 TestServiceProvider::Create(env()->isolate()); |
| 165 service_provider_ = service_provider.get(); | 165 service_provider_ = service_provider.get(); |
| 166 gin::ModuleRegistry::From(env()->context()->v8_context()) | 166 gin::ModuleRegistry::From(env()->context()->v8_context()) |
| 167 ->AddBuiltinModule(env()->isolate(), | 167 ->AddBuiltinModule(env()->isolate(), |
| 168 "content/public/renderer/service_provider", | 168 "content/public/renderer/frame_service_registry", |
| 169 service_provider.ToV8()); | 169 service_provider.ToV8()); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void ApiTestEnvironment::InitializeEnvironment() { | 172 void ApiTestEnvironment::InitializeEnvironment() { |
| 173 gin::Dictionary global(env()->isolate(), | 173 gin::Dictionary global(env()->isolate(), |
| 174 env()->context()->v8_context()->Global()); | 174 env()->context()->v8_context()->Global()); |
| 175 gin::Dictionary navigator(gin::Dictionary::CreateEmpty(env()->isolate())); | 175 gin::Dictionary navigator(gin::Dictionary::CreateEmpty(env()->isolate())); |
| 176 navigator.Set("appVersion", base::StringPiece("")); | 176 navigator.Set("appVersion", base::StringPiece("")); |
| 177 global.Set("navigator", navigator); | 177 global.Set("navigator", navigator); |
| 178 gin::Dictionary chrome(gin::Dictionary::CreateEmpty(env()->isolate())); | 178 gin::Dictionary chrome(gin::Dictionary::CreateEmpty(env()->isolate())); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 test_env_.reset(new ApiTestEnvironment(env())); | 231 test_env_.reset(new ApiTestEnvironment(env())); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void ApiTestBase::RunTest(const std::string& file_name, | 234 void ApiTestBase::RunTest(const std::string& file_name, |
| 235 const std::string& test_name) { | 235 const std::string& test_name) { |
| 236 ExpectNoAssertionsMade(); | 236 ExpectNoAssertionsMade(); |
| 237 test_env_->RunTest(file_name, test_name); | 237 test_env_->RunTest(file_name, test_name); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace extensions | 240 } // namespace extensions |
| OLD | NEW |