| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "extensions/common/extension_urls.h" | 10 #include "extensions/common/extension_urls.h" |
| 11 #include "extensions/renderer/dispatcher.h" | 11 #include "extensions/renderer/dispatcher.h" |
| 12 #include "extensions/renderer/process_info_native_handler.h" | 12 #include "extensions/renderer/process_info_native_handler.h" |
| 13 #include "gin/converter.h" | 13 #include "gin/converter.h" |
| 14 #include "gin/dictionary.h" | 14 #include "gin/dictionary.h" |
| 15 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| 16 #include "third_party/mojo/src/mojo/public/cpp/system/core.h" |
| 17 |
| 18 #if defined(USE_CHROME_EDK) |
| 19 #include "mojo/edk/js/core.h" |
| 20 #include "mojo/edk/js/handle.h" |
| 21 #include "mojo/edk/js/support.h" |
| 22 #else |
| 15 #include "third_party/mojo/src/mojo/edk/js/core.h" | 23 #include "third_party/mojo/src/mojo/edk/js/core.h" |
| 16 #include "third_party/mojo/src/mojo/edk/js/handle.h" | 24 #include "third_party/mojo/src/mojo/edk/js/handle.h" |
| 17 #include "third_party/mojo/src/mojo/edk/js/support.h" | 25 #include "third_party/mojo/src/mojo/edk/js/support.h" |
| 18 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" | 26 #endif |
| 19 #include "third_party/mojo/src/mojo/public/cpp/system/core.h" | |
| 20 | 27 |
| 21 namespace extensions { | 28 namespace extensions { |
| 22 namespace { | 29 namespace { |
| 23 | 30 |
| 24 // Natives for the implementation of the unit test version of chrome.test. Calls | 31 // Natives for the implementation of the unit test version of chrome.test. Calls |
| 25 // the provided |quit_closure| when either notifyPass or notifyFail is called. | 32 // the provided |quit_closure| when either notifyPass or notifyFail is called. |
| 26 class TestNatives : public gin::Wrappable<TestNatives> { | 33 class TestNatives : public gin::Wrappable<TestNatives> { |
| 27 public: | 34 public: |
| 28 static gin::Handle<TestNatives> Create(v8::Isolate* isolate, | 35 static gin::Handle<TestNatives> Create(v8::Isolate* isolate, |
| 29 const base::Closure& quit_closure) { | 36 const base::Closure& quit_closure) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 test_env_.reset(new ApiTestEnvironment(env())); | 238 test_env_.reset(new ApiTestEnvironment(env())); |
| 232 } | 239 } |
| 233 | 240 |
| 234 void ApiTestBase::RunTest(const std::string& file_name, | 241 void ApiTestBase::RunTest(const std::string& file_name, |
| 235 const std::string& test_name) { | 242 const std::string& test_name) { |
| 236 ExpectNoAssertionsMade(); | 243 ExpectNoAssertionsMade(); |
| 237 test_env_->RunTest(file_name, test_name); | 244 test_env_->RunTest(file_name, test_name); |
| 238 } | 245 } |
| 239 | 246 |
| 240 } // namespace extensions | 247 } // namespace extensions |
| OLD | NEW |