summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui
diff options
context:
space:
mode:
authorpatrick@chromium.org <patrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 23:39:51 +0000
committerpatrick@chromium.org <patrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 23:39:51 +0000
commit0e8ada09ab49bafd0841393ef30ad550ecf9dfcb (patch)
treea4f893954972656890d0a41a4828b737f1e6b6fd /chrome/test/ui
parentc3c5ac4e6b342c064e2c422d61913df2066cc882 (diff)
downloadchromium_src-0e8ada09ab49bafd0841393ef30ad550ecf9dfcb.zip
chromium_src-0e8ada09ab49bafd0841393ef30ad550ecf9dfcb.tar.gz
chromium_src-0e8ada09ab49bafd0841393ef30ad550ecf9dfcb.tar.bz2
Add --js-flags to the list of flags accepted by UI tests.
Review URL: http://codereview.chromium.org/4290 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-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() {