Delete chromeHidden! This involves (a) moving all the remaining modules
exported on chromeHidden into module system exports (notably Event and
JSONSchemaValidator) and (b) moving all of the local state stored on
chromeHidden into local variables.

[email protected]

BUG=55316, 244205

Review URL: https://codereview.chromium.org/16256026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204396 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/test/base/module_system_test.cc b/chrome/test/base/module_system_test.cc
index ea144c2..c8bfe0c3 100644
--- a/chrome/test/base/module_system_test.cc
+++ b/chrome/test/base/module_system_test.cc
@@ -5,9 +5,14 @@
 #include "chrome/test/base/module_system_test.h"
 
 #include "base/callback.h"
+#include "base/file_util.h"
+#include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/path_service.h"
 #include "base/strings/string_piece.h"
+#include "chrome/common/chrome_paths.h"
 #include "chrome/renderer/extensions/chrome_v8_context.h"
+#include "chrome/renderer/extensions/logging_native_handler.h"
 #include "chrome/renderer/extensions/object_backed_native_handler.h"
 #include "ui/base/resource/resource_bundle.h"
 
@@ -101,6 +106,8 @@
   module_system_.reset(new ModuleSystem(context_.get(), source_map_.get()));
   module_system_->RegisterNativeHandler("assert", scoped_ptr<NativeHandler>(
       assert_natives_));
+  module_system_->RegisterNativeHandler("logging", scoped_ptr<NativeHandler>(
+      new extensions::LoggingNativeHandler(context_.get())));
   module_system_->SetExceptionHandlerForTest(
       scoped_ptr<ModuleSystem::ExceptionHandler>(new FailsOnException));
 }
@@ -128,6 +135,17 @@
   module_system_->OverrideNativeHandlerForTest(name);
 }
 
+void ModuleSystemTest::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);
+  std::string test_js;
+  ASSERT_TRUE(file_util::ReadFileToString(test_js_file_path, &test_js));
+  source_map_->RegisterModule(module_name, test_js);
+}
+
 void ModuleSystemTest::TearDown() {
   // All tests must assert at least once unless otherwise specified.
   EXPECT_EQ(should_assertions_be_made_,