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

Side by Side Diff: chrome/test/base/module_system_test.h

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
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 "chrome/renderer/extensions/scoped_persistent.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:
18 // 19 //
(...skipping 24 matching lines...) Expand all
43 // name. 44 // name.
44 void OverrideNativeHandler(const std::string& name, const std::string& code); 45 void OverrideNativeHandler(const std::string& name, const std::string& code);
45 46
46 // Make the test fail if any asserts are called. By default a test will fail 47 // Make the test fail if any asserts are called. By default a test will fail
47 // if no asserts are called. 48 // if no asserts are called.
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 extensions::ScopedPersistent<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_;
58 bool should_assertions_be_made_; 59 bool should_assertions_be_made_;
59 }; 60 };
60 61
61 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_ 62 #endif // CHROME_TEST_BASE_MODULE_SYSTEM_TEST_H_
OLDNEW
« no previous file with comments | « chrome/renderer/resources/renderer_resources.grd ('k') | chrome/test/base/module_system_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698