OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
6 #define CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 6 #define CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
7 | 7 |
8 #include "chrome/renderer/extensions/chrome_v8_context.h" | |
8 #include "chrome/renderer/extensions/module_system.h" | 9 #include "chrome/renderer/extensions/module_system.h" |
9 #include "chrome/renderer/extensions/scoped_persistent.h" | 10 #include "chrome/renderer/extensions/scoped_persistent.h" |
10 #include "v8/include/v8.h" | 11 #include "v8/include/v8.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 class AssertNatives; | 14 class AssertNatives; |
14 class StringSourceMap; | 15 class StringSourceMap; |
15 | 16 |
16 // Test fixture for testing JS that makes use of the module system. | 17 // Test fixture for testing JS that makes use of the module system. |
17 // | 18 // |
(...skipping 29 matching lines...) Expand all Loading... | |
47 // Make the test fail if any asserts are called. By default a test will fail | 48 // Make the test fail if any asserts are called. By default a test will fail |
48 // if no asserts are called. | 49 // if no asserts are called. |
49 void ExpectNoAssertionsMade(); | 50 void ExpectNoAssertionsMade(); |
50 | 51 |
51 // Create an empty object in the global scope with name |name|. | 52 // Create an empty object in the global scope with name |name|. |
52 v8::Handle<v8::Object> CreateGlobal(const std::string& name); | 53 v8::Handle<v8::Object> CreateGlobal(const std::string& name); |
53 | 54 |
54 v8::Isolate* isolate_; | 55 v8::Isolate* isolate_; |
55 v8::HandleScope handle_scope_; | 56 v8::HandleScope handle_scope_; |
56 extensions::ScopedPersistent<v8::Context> context_; | 57 extensions::ScopedPersistent<v8::Context> context_; |
58 scoped_ptr<extensions::ChromeV8Context> chrome_v8_context_; | |
not at google - send to devlin
2013/05/29 15:55:13
It would be nicer if this were just scoped_ptr<e::
marja
2013/05/29 16:56:33
Done.
| |
57 AssertNatives* assert_natives_; | 59 AssertNatives* assert_natives_; |
58 scoped_ptr<StringSourceMap> source_map_; | 60 scoped_ptr<StringSourceMap> source_map_; |
59 scoped_ptr<extensions::ModuleSystem> module_system_; | 61 scoped_ptr<extensions::ModuleSystem> module_system_; |
60 bool should_assertions_be_made_; | 62 bool should_assertions_be_made_; |
61 | 63 |
62 private: | 64 private: |
63 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); | 65 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); |
64 }; | 66 }; |
65 | 67 |
66 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 68 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
OLD | NEW |