| 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 "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 class AssertNatives; | 13 class AssertNatives; |
| 13 class StringSourceMap; | 14 class StringSourceMap; |
| 14 | 15 |
| 15 // Test fixture for testing JS that makes use of the module system. | 16 // Test fixture for testing JS that makes use of the module system. |
| 16 // | 17 // |
| 17 // Typically tests will look like: | 18 // Typically tests will look like: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 void ExpectNoAssertionsMade(); | 49 void ExpectNoAssertionsMade(); |
| 49 | 50 |
| 50 // Create an empty object in the global scope with name |name|. | 51 // Create an empty object in the global scope with name |name|. |
| 51 v8::Handle<v8::Object> CreateGlobal(const std::string& name); | 52 v8::Handle<v8::Object> CreateGlobal(const std::string& name); |
| 52 | 53 |
| 53 v8::Persistent<v8::Context> context_; | 54 v8::Persistent<v8::Context> context_; |
| 54 v8::HandleScope handle_scope_; | 55 v8::HandleScope handle_scope_; |
| 55 AssertNatives* assert_natives_; | 56 AssertNatives* assert_natives_; |
| 56 scoped_ptr<StringSourceMap> source_map_; | 57 scoped_ptr<StringSourceMap> source_map_; |
| 57 scoped_ptr<extensions::ModuleSystem> module_system_; | 58 scoped_ptr<extensions::ModuleSystem> module_system_; |
| 59 scoped_ptr<extensions::ChromeV8Context> v8_context_; |
| 58 bool should_assertions_be_made_; | 60 bool should_assertions_be_made_; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 63 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
| OLD | NEW |