| 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 "mojo/edk/js/core.h" | 15 #include "third_party/mojo/src/mojo/edk/js/core.h" |
| 16 #include "mojo/edk/js/handle.h" | 16 #include "third_party/mojo/src/mojo/edk/js/handle.h" |
| 17 #include "mojo/edk/js/support.h" | 17 #include "third_party/mojo/src/mojo/edk/js/support.h" |
| 18 #include "mojo/public/cpp/bindings/interface_request.h" | 18 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| 19 #include "mojo/public/cpp/system/core.h" | 19 #include "third_party/mojo/src/mojo/public/cpp/system/core.h" |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Natives for the implementation of the unit test version of chrome.test. Calls | 24 // 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. | 25 // the provided |quit_closure| when either notifyPass or notifyFail is called. |
| 26 class TestNatives : public gin::Wrappable<TestNatives> { | 26 class TestNatives : public gin::Wrappable<TestNatives> { |
| 27 public: | 27 public: |
| 28 static gin::Handle<TestNatives> Create(v8::Isolate* isolate, | 28 static gin::Handle<TestNatives> Create(v8::Isolate* isolate, |
| 29 const base::Closure& quit_closure) { | 29 const base::Closure& quit_closure) { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 void ApiTestBase::RunPromisesAgain() { | 219 void ApiTestBase::RunPromisesAgain() { |
| 220 RunResolvedPromises(); | 220 RunResolvedPromises(); |
| 221 base::MessageLoop::current()->PostTask( | 221 base::MessageLoop::current()->PostTask( |
| 222 FROM_HERE, | 222 FROM_HERE, |
| 223 base::Bind(&ApiTestBase::RunPromisesAgain, base::Unretained(this))); | 223 base::Bind(&ApiTestBase::RunPromisesAgain, base::Unretained(this))); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace extensions | 226 } // namespace extensions |
| OLD | NEW |