| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 ++resource) { | 121 ++resource) { |
| 122 if (resource->first != "test_environment_specific_bindings") | 122 if (resource->first != "test_environment_specific_bindings") |
| 123 env()->RegisterModule(resource->first, resource->second); | 123 env()->RegisterModule(resource->first, resource->second); |
| 124 } | 124 } |
| 125 Dispatcher::RegisterNativeHandlers(env()->module_system(), | 125 Dispatcher::RegisterNativeHandlers(env()->module_system(), |
| 126 env()->context(), | 126 env()->context(), |
| 127 NULL, | 127 NULL, |
| 128 NULL, | 128 NULL, |
| 129 v8_schema_registry_.get()); | 129 v8_schema_registry_.get()); |
| 130 env()->module_system()->RegisterNativeHandler( | 130 env()->module_system()->RegisterNativeHandler( |
| 131 "process", | 131 "process", std::unique_ptr<NativeHandler>(new ProcessInfoNativeHandler( |
| 132 scoped_ptr<NativeHandler>(new ProcessInfoNativeHandler( | 132 env()->context(), env()->context()->GetExtensionID(), |
| 133 env()->context(), | 133 env()->context()->GetContextTypeDescription(), false, |
| 134 env()->context()->GetExtensionID(), | 134 false, 2, false))); |
| 135 env()->context()->GetContextTypeDescription(), | |
| 136 false, | |
| 137 false, | |
| 138 2, | |
| 139 false))); | |
| 140 env()->RegisterTestFile("test_environment_specific_bindings", | 135 env()->RegisterTestFile("test_environment_specific_bindings", |
| 141 "unit_test_environment_specific_bindings.js"); | 136 "unit_test_environment_specific_bindings.js"); |
| 142 | 137 |
| 143 env()->OverrideNativeHandler("activityLogger", | 138 env()->OverrideNativeHandler("activityLogger", |
| 144 "exports.$set('LogAPICall', function() {});"); | 139 "exports.$set('LogAPICall', function() {});"); |
| 145 env()->OverrideNativeHandler( | 140 env()->OverrideNativeHandler( |
| 146 "apiDefinitions", | 141 "apiDefinitions", |
| 147 "exports.$set('GetExtensionAPIDefinitionsForTest'," | 142 "exports.$set('GetExtensionAPIDefinitionsForTest'," |
| 148 "function() { return [] });"); | 143 "function() { return [] });"); |
| 149 env()->OverrideNativeHandler( | 144 env()->OverrideNativeHandler( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 test_env_.reset(new ApiTestEnvironment(env())); | 226 test_env_.reset(new ApiTestEnvironment(env())); |
| 232 } | 227 } |
| 233 | 228 |
| 234 void ApiTestBase::RunTest(const std::string& file_name, | 229 void ApiTestBase::RunTest(const std::string& file_name, |
| 235 const std::string& test_name) { | 230 const std::string& test_name) { |
| 236 ExpectNoAssertionsMade(); | 231 ExpectNoAssertionsMade(); |
| 237 test_env_->RunTest(file_name, test_name); | 232 test_env_->RunTest(file_name, test_name); |
| 238 } | 233 } |
| 239 | 234 |
| 240 } // namespace extensions | 235 } // namespace extensions |
| OLD | NEW |