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

Unified Diff: extensions/renderer/module_system_test.cc

Issue 375243002: Move ModuleSystemTest and the tests that use it into extensions/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/module_system_test.cc
diff --git a/chrome/test/base/module_system_test.cc b/extensions/renderer/module_system_test.cc
similarity index 93%
rename from chrome/test/base/module_system_test.cc
rename to extensions/renderer/module_system_test.cc
index 88f979b7145a942c326b2b77579634ac84a6146a..cc023f5ebbd992bce45fe9c5418cbd26cda6147a 100644
--- a/chrome/test/base/module_system_test.cc
+++ b/extensions/renderer/module_system_test.cc
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/test/base/module_system_test.h"
+#include "extensions/renderer/module_system_test.h"
+
+#include <map>
+#include <string>
#include "base/callback.h"
#include "base/file_util.h"
@@ -12,17 +15,13 @@
#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/renderer/extensions/chrome_v8_context.h"
+#include "extensions/common/extension_paths.h"
#include "extensions/renderer/logging_native_handler.h"
#include "extensions/renderer/object_backed_native_handler.h"
#include "extensions/renderer/safe_builtins.h"
#include "extensions/renderer/utils_native_handler.h"
#include "ui/base/resource/resource_bundle.h"
-#include <map>
-#include <string>
-
using extensions::ModuleSystem;
using extensions::NativeHandler;
using extensions::ObjectBackedNativeHandler;
@@ -42,7 +41,7 @@ class V8ExtensionConfigurator {
: safe_builtins_(extensions::SafeBuiltins::CreateV8Extension()),
names_(1, safe_builtins_->name()),
configuration_(new v8::ExtensionConfiguration(
- names_.size(), vector_as_array(&names_))) {
+ static_cast<int>(names_.size()), vector_as_array(&names_))) {
v8::RegisterExtension(safe_builtins_.get());
}
@@ -65,7 +64,7 @@ base::LazyInstance<V8ExtensionConfigurator>::Leaky g_v8_extension_configurator =
class ModuleSystemTestEnvironment::AssertNatives
: public ObjectBackedNativeHandler {
public:
- explicit AssertNatives(extensions::ChromeV8Context* context)
+ explicit AssertNatives(extensions::ScriptContext* context)
: ObjectBackedNativeHandler(context),
assertion_made_(false),
failed_(false) {
@@ -131,7 +130,7 @@ ModuleSystemTestEnvironment::ModuleSystemTestEnvironment(
context_holder_->SetContext(
v8::Context::New(isolate_holder->isolate(),
g_v8_extension_configurator.Get().GetConfiguration()));
- context_.reset(new extensions::ChromeV8Context(
+ context_.reset(new extensions::ScriptContext(
context_holder_->context(),
NULL, // WebFrame
NULL, // Extension
@@ -183,9 +182,8 @@ void ModuleSystemTestEnvironment::RegisterTestFile(
const std::string& module_name,
const std::string& file_name) {
base::FilePath test_js_file_path;
- ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_js_file_path));
- test_js_file_path = test_js_file_path.AppendASCII("extensions")
- .AppendASCII(file_name);
+ ASSERT_TRUE(PathService::Get(extensions::DIR_TEST_DATA, &test_js_file_path));
+ test_js_file_path = test_js_file_path.AppendASCII(file_name);
std::string test_js;
ASSERT_TRUE(base::ReadFileToString(test_js_file_path, &test_js));
source_map_->RegisterModule(module_name, test_js);

Powered by Google App Engine
This is Rietveld 408576698