| 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 28 matching lines...) Expand all Loading... |
| 46 | 47 |
| 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 scoped_ptr<extensions::ChromeV8Context> context_; |
| 57 AssertNatives* assert_natives_; | 58 AssertNatives* assert_natives_; |
| 58 scoped_ptr<StringSourceMap> source_map_; | 59 scoped_ptr<StringSourceMap> source_map_; |
| 59 scoped_ptr<extensions::ModuleSystem> module_system_; | 60 scoped_ptr<extensions::ModuleSystem> module_system_; |
| 60 bool should_assertions_be_made_; | 61 bool should_assertions_be_made_; |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); | 64 DISALLOW_COPY_AND_ASSIGN(ModuleSystemTest); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 67 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
| OLD | NEW |