Commit cc99db6d authored by kkania@chromium.org's avatar kkania@chromium.org

Disable pyauto tests on mac that requires py2.6. Fix 2 failing chromedriver

tests.
BUG=none
TEST=none
TBR=hnguyen

Review URL: http://codereview.chromium.org/7640017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96562 0039d316-1c4b-4281-b951-d872f2087c98
parent b6cf7684
......@@ -195,6 +195,9 @@
'-omnibox.OmniboxTest.testOmniboxSearchHistory',
# Keychain popups make autofill/password tests difficult: crbug.com/49378
'-passwords',
# WebDriver requires python 2.6, which mac pyauto does not use yet.
# crbug.com/49379
'-pyauto_webdriver',
# crbug.com/79263
'-popups.PopupsTest.testPopupsLaunchUponBrowserBackButton',
# crbug.com/69619
......
......@@ -184,7 +184,7 @@ bool GetDefaultChromeExe(FilePath* browser_exe) {
namespace webdriver {
Automation::BrowserOptions::BrowserOptions()
: cmdline(CommandLine::NO_PROGRAM) {}
: command(CommandLine::NO_PROGRAM) {}
Automation::BrowserOptions::~BrowserOptions() {}
......@@ -193,48 +193,51 @@ Automation::Automation() {}
Automation::~Automation() {}
void Automation::Init(const BrowserOptions& options, Error** error) {
CommandLine cmdline = options.cmdline;
if (cmdline.GetProgram().empty()) {
// Prepare Chrome's command line.
CommandLine command(CommandLine::NO_PROGRAM);
command.AppendSwitch(switches::kDisableHangMonitor);
command.AppendSwitch(switches::kDisablePromptOnRepost);
command.AppendSwitch(switches::kDomAutomationController);
command.AppendSwitch(switches::kFullMemoryCrashReport);
command.AppendSwitch(switches::kNoDefaultBrowserCheck);
command.AppendSwitch(switches::kNoFirstRun);
if (options.user_data_dir.empty())
command.AppendSwitchASCII(switches::kHomePage, chrome::kAboutBlankURL);
command.AppendArguments(options.command, true /* include_program */);
// Find the Chrome binary.
if (command.GetProgram().empty()) {
FilePath browser_exe;
if (!GetDefaultChromeExe(&browser_exe)) {
*error = new Error(kUnknownError, "Could not find default Chrome binary");
return;
}
cmdline.SetProgram(browser_exe);
command.SetProgram(browser_exe);
}
if (!file_util::PathExists(cmdline.GetProgram())) {
if (!file_util::PathExists(command.GetProgram())) {
std::string message = base::StringPrintf(
"Could not find Chrome binary at: %" PRFilePath,
cmdline.GetProgram().value().c_str());
command.GetProgram().value().c_str());
*error = new Error(kUnknownError, message);
return;
}
std::string chrome_details = base::StringPrintf(
"Using Chrome binary at: %" PRFilePath,
cmdline.GetProgram().value().c_str());
command.GetProgram().value().c_str());
LOG(INFO) << chrome_details;
cmdline.AppendSwitch(switches::kDisableHangMonitor);
cmdline.AppendSwitch(switches::kDisablePromptOnRepost);
cmdline.AppendSwitch(switches::kDomAutomationController);
cmdline.AppendSwitch(switches::kFullMemoryCrashReport);
cmdline.AppendSwitch(switches::kNoDefaultBrowserCheck);
cmdline.AppendSwitch(switches::kNoFirstRun);
if (options.user_data_dir.empty())
cmdline.AppendSwitchASCII(switches::kHomePage, chrome::kAboutBlankURL);
// Create the ProxyLauncher and launch Chrome.
if (options.channel_id.empty()) {
launcher_.reset(new AnonymousProxyLauncher(false));
} else {
launcher_.reset(new NamedProxyLauncher(options.channel_id, false, false));
}
ProxyLauncher::LaunchState launch_props = {
false, // clear_profile
options.user_data_dir, // template_user_data
base::Closure(),
cmdline,
command,
true, // include_testing_id
true // show_window
};
......@@ -251,6 +254,7 @@ void Automation::Init(const BrowserOptions& options, Error** error) {
LOG(INFO) << "Chrome launched successfully. Version: "
<< automation()->server_version();
// Check the version of Chrome is compatible with this ChromeDriver.
chrome_details += ", version (" + automation()->server_version() + ")";
int version = 0;
std::string error_msg;
......
......@@ -45,7 +45,7 @@ class Automation {
BrowserOptions();
~BrowserOptions();
CommandLine cmdline;
CommandLine command;
FilePath user_data_dir;
std::string channel_id;
};
......
......@@ -76,7 +76,7 @@ void CreateSession::ExecutePost(Response* const response) {
Automation::BrowserOptions browser_options;
FilePath::StringType path;
if (capabilities->GetStringWithoutPathExpansion("chrome.binary", &path))
browser_options.cmdline = CommandLine(FilePath(path));
browser_options.command = CommandLine(FilePath(path));
ListValue* switches = NULL;
const char* kCustomSwitchesKey = "chrome.switches";
......@@ -97,11 +97,11 @@ void CreateSession::ExecutePost(Response* const response) {
kBadRequest, "Custom switch is not a string"));
return;
}
browser_options.cmdline.AppendSwitchNative(
browser_options.command.AppendSwitchNative(
switch_string.substr(0, separator_index),
switch_string_native.substr(separator_index + 1));
} else {
browser_options.cmdline.AppendSwitch(switch_string);
browser_options.command.AppendSwitch(switch_string);
}
}
} else if (capabilities->HasKey(kCustomSwitchesKey)) {
......@@ -130,8 +130,6 @@ void CreateSession::ExecutePost(Response* const response) {
"chrome.channel", &browser_options.channel_id);
ScopedTempDir temp_profile_dir;
FilePath temp_user_data_dir;
std::string base64_profile;
if (capabilities->GetStringWithoutPathExpansion("chrome.profile",
&base64_profile)) {
......@@ -148,8 +146,9 @@ void CreateSession::ExecutePost(Response* const response) {
return;
}
temp_user_data_dir = temp_profile_dir.path().AppendASCII("user_data_dir");
if (!Unzip(temp_profile_zip, temp_user_data_dir)) {
browser_options.user_data_dir =
temp_profile_dir.path().AppendASCII("user_data_dir");
if (!Unzip(temp_profile_zip, browser_options.user_data_dir)) {
response->SetError(new Error(
kBadRequest, "Could not unarchive provided user profile"));
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment