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

Side by Side Diff: extensions/renderer/module_system_test.h

Issue 2876123003: Add ScopedTaskEnvironment in extensions::ModuleSystemTest. (Closed)
Patch Set: Created 3 years, 7 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') | no next file » | 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 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ 5 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_
6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ 6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/test/scoped_task_environment.h"
9 #include "extensions/renderer/module_system.h" 10 #include "extensions/renderer/module_system.h"
10 #include "extensions/renderer/script_context.h" 11 #include "extensions/renderer/script_context.h"
11 #include "gin/public/context_holder.h" 12 #include "gin/public/context_holder.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 #include "v8/include/v8.h" 14 #include "v8/include/v8.h"
14 15
15 namespace extensions { 16 namespace extensions {
16 class StringSourceMap; 17 class StringSourceMap;
17 18
18 class ModuleSystemTestEnvironment { 19 class ModuleSystemTestEnvironment {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 92
92 // Make the test fail if any asserts are called. By default a test will fail 93 // Make the test fail if any asserts are called. By default a test will fail
93 // if no asserts are called. 94 // if no asserts are called.
94 void ExpectNoAssertionsMade(); 95 void ExpectNoAssertionsMade();
95 96
96 // Runs promises that have been resolved. Resolved promises will not run 97 // Runs promises that have been resolved. Resolved promises will not run
97 // until this is called. 98 // until this is called.
98 void RunResolvedPromises(); 99 void RunResolvedPromises();
99 100
100 private: 101 private:
102 base::test::ScopedTaskEnvironment scoped_task_environment_;
101 v8::Isolate* isolate_; 103 v8::Isolate* isolate_;
102 std::unique_ptr<ModuleSystemTestEnvironment> env_; 104 std::unique_ptr<ModuleSystemTestEnvironment> env_;
103 bool should_assertions_be_made_; 105 bool should_assertions_be_made_;
104 106
105 private: 107 private:
106 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); 108 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest);
107 }; 109 };
108 110
109 } // namespace extensions 111 } // namespace extensions
110 112
111 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_ 113 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_TEST_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698