summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/test/ui/ui_test.cc5
-rw-r--r--chrome/test/ui/ui_test.h6
-rw-r--r--chrome/test/ui/ui_test_suite.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index d6949e5d..1b47e7d 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -41,6 +41,7 @@ bool UITest::enable_dcheck_ = false;
bool UITest::silent_dump_on_dcheck_ = false;
bool UITest::disable_breakpad_ = false;
int UITest::timeout_ms_ = 20 * 60 * 1000;
+std::wstring UITest::js_flags_ = L"";
// Uncomment this line to have the spawned process wait for the debugger to
// attach.
@@ -197,6 +198,10 @@ void UITest::LaunchBrowser(const std::wstring& arguments, bool clear_profile) {
CommandLine::AppendSwitchWithValue(&command_line,
switches::kUserDataDir,
user_data_dir_);
+ if (!js_flags_.empty())
+ CommandLine::AppendSwitchWithValue(&command_line,
+ switches::kJavaScriptFlags,
+ js_flags_);
CommandLine::AppendSwitch(&command_line, switches::kDisableMetricsReporting);
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index fe080a0..5752bc7 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -240,6 +240,11 @@ class UITest : public testing::Test {
timeout_ms_ = value;
}
+ static std::wstring js_flags() { return js_flags_; }
+ static void set_js_flags(const std::wstring& value) {
+ js_flags_ = value;
+ }
+
// Called by some tests that wish to have a base profile to start from. This
// "user data directory" (containing one or more profiles) will be recursively
// copied into the user data directory for the test and the files will be
@@ -340,6 +345,7 @@ class UITest : public testing::Test {
static bool disable_breakpad_; // Disable breakpad on the browser.
static int timeout_ms_; // Timeout in milliseconds to wait
// for an test to finish.
+ static std::wstring js_flags_; // Flags passed to the JS engine.
::scoped_ptr<AutomationProxy> server_;
MessageLoop message_loop_; // Enables PostTask to main thread.
diff --git a/chrome/test/ui/ui_test_suite.h b/chrome/test/ui/ui_test_suite.h
index d15db81..e2976412e 100644
--- a/chrome/test/ui/ui_test_suite.h
+++ b/chrome/test/ui/ui_test_suite.h
@@ -44,6 +44,11 @@ class UITestSuite : public ChromeTestSuite {
if (!test_timeout.empty()) {
UITest::set_test_timeout_ms(_wtoi(test_timeout.c_str()));
}
+ std::wstring js_flags =
+ parsed_command_line.GetSwitchValue(switches::kJavaScriptFlags);
+ if (!js_flags.empty()) {
+ UITest::set_js_flags(js_flags);
+ }
}
virtual void SuppressErrorDialogs() {