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/module_system.h" | 8 #include "chrome/renderer/extensions/module_system.h" |
9 #include "v8/include/v8.h" | 9 #include "v8/include/v8.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Make the test fail if any asserts are called. By default a test will fail | 46 // Make the test fail if any asserts are called. By default a test will fail |
47 // if no asserts are called. | 47 // if no asserts are called. |
48 void ExpectNoAssertionsMade(); | 48 void ExpectNoAssertionsMade(); |
49 | 49 |
50 // Create an empty object in the global scope with name |name|. | 50 // Create an empty object in the global scope with name |name|. |
51 v8::Handle<v8::Object> CreateGlobal(const std::string& name); | 51 v8::Handle<v8::Object> CreateGlobal(const std::string& name); |
52 | 52 |
53 v8::Persistent<v8::Context> context_; | 53 v8::Persistent<v8::Context> context_; |
54 v8::HandleScope handle_scope_; | 54 v8::HandleScope handle_scope_; |
55 v8::TryCatch try_catch_; | |
56 AssertNatives* assert_natives_; | 55 AssertNatives* assert_natives_; |
57 scoped_ptr<StringSourceMap> source_map_; | 56 scoped_ptr<StringSourceMap> source_map_; |
58 scoped_ptr<extensions::ModuleSystem> module_system_; | 57 scoped_ptr<extensions::ModuleSystem> module_system_; |
59 bool should_assertions_be_made_; | 58 bool should_assertions_be_made_; |
60 }; | 59 }; |
61 | 60 |
62 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ | 61 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ |
OLD | NEW |