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 @@ ...@@ -195,6 +195,9 @@
'-omnibox.OmniboxTest.testOmniboxSearchHistory', '-omnibox.OmniboxTest.testOmniboxSearchHistory',
# Keychain popups make autofill/password tests difficult: crbug.com/49378 # Keychain popups make autofill/password tests difficult: crbug.com/49378
'-passwords', '-passwords',
# WebDriver requires python 2.6, which mac pyauto does not use yet.
# crbug.com/49379
'-pyauto_webdriver',
# crbug.com/79263 # crbug.com/79263
'-popups.PopupsTest.testPopupsLaunchUponBrowserBackButton', '-popups.PopupsTest.testPopupsLaunchUponBrowserBackButton',
# crbug.com/69619 # crbug.com/69619
......
...@@ -184,7 +184,7 @@ bool GetDefaultChromeExe(FilePath* browser_exe) { ...@@ -184,7 +184,7 @@ bool GetDefaultChromeExe(FilePath* browser_exe) {
namespace webdriver { namespace webdriver {
Automation::BrowserOptions::BrowserOptions() Automation::BrowserOptions::BrowserOptions()
: cmdline(CommandLine::NO_PROGRAM) {} : command(CommandLine::NO_PROGRAM) {}
Automation::BrowserOptions::~BrowserOptions() {} Automation::BrowserOptions::~BrowserOptions() {}
...@@ -193,48 +193,51 @@ Automation::Automation() {} ...@@ -193,48 +193,51 @@ Automation::Automation() {}
Automation::~Automation() {} Automation::~Automation() {}
void Automation::Init(const BrowserOptions& options, Error** error) { void Automation::Init(const BrowserOptions& options, Error** error) {
CommandLine cmdline = options.cmdline; // Prepare Chrome's command line.
if (cmdline.GetProgram().empty()) { 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; FilePath browser_exe;
if (!GetDefaultChromeExe(&browser_exe)) { if (!GetDefaultChromeExe(&browser_exe)) {
*error = new Error(kUnknownError, "Could not find default Chrome binary"); *error = new Error(kUnknownError, "Could not find default Chrome binary");
return; 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( std::string message = base::StringPrintf(
"Could not find Chrome binary at: %" PRFilePath, "Could not find Chrome binary at: %" PRFilePath,
cmdline.GetProgram().value().c_str()); command.GetProgram().value().c_str());
*error = new Error(kUnknownError, message); *error = new Error(kUnknownError, message);
return; return;
} }
std::string chrome_details = base::StringPrintf( std::string chrome_details = base::StringPrintf(
"Using Chrome binary at: %" PRFilePath, "Using Chrome binary at: %" PRFilePath,
cmdline.GetProgram().value().c_str()); command.GetProgram().value().c_str());
LOG(INFO) << chrome_details; LOG(INFO) << chrome_details;
cmdline.AppendSwitch(switches::kDisableHangMonitor); // Create the ProxyLauncher and launch Chrome.
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);
if (options.channel_id.empty()) { if (options.channel_id.empty()) {
launcher_.reset(new AnonymousProxyLauncher(false)); launcher_.reset(new AnonymousProxyLauncher(false));
} else { } else {
launcher_.reset(new NamedProxyLauncher(options.channel_id, false, false)); launcher_.reset(new NamedProxyLauncher(options.channel_id, false, false));
} }
ProxyLauncher::LaunchState launch_props = { ProxyLauncher::LaunchState launch_props = {
false, // clear_profile false, // clear_profile
options.user_data_dir, // template_user_data options.user_data_dir, // template_user_data
base::Closure(), base::Closure(),
cmdline, command,
true, // include_testing_id true, // include_testing_id
true // show_window true // show_window
}; };
...@@ -251,6 +254,7 @@ void Automation::Init(const BrowserOptions& options, Error** error) { ...@@ -251,6 +254,7 @@ void Automation::Init(const BrowserOptions& options, Error** error) {
LOG(INFO) << "Chrome launched successfully. Version: " LOG(INFO) << "Chrome launched successfully. Version: "
<< automation()->server_version(); << automation()->server_version();
// Check the version of Chrome is compatible with this ChromeDriver.
chrome_details += ", version (" + automation()->server_version() + ")"; chrome_details += ", version (" + automation()->server_version() + ")";
int version = 0; int version = 0;
std::string error_msg; std::string error_msg;
......
...@@ -45,7 +45,7 @@ class Automation { ...@@ -45,7 +45,7 @@ class Automation {
BrowserOptions(); BrowserOptions();
~BrowserOptions(); ~BrowserOptions();
CommandLine cmdline; CommandLine command;
FilePath user_data_dir; FilePath user_data_dir;
std::string channel_id; std::string channel_id;
}; };
......
...@@ -76,7 +76,7 @@ void CreateSession::ExecutePost(Response* const response) { ...@@ -76,7 +76,7 @@ void CreateSession::ExecutePost(Response* const response) {
Automation::BrowserOptions browser_options; Automation::BrowserOptions browser_options;
FilePath::StringType path; FilePath::StringType path;
if (capabilities->GetStringWithoutPathExpansion("chrome.binary", &path)) if (capabilities->GetStringWithoutPathExpansion("chrome.binary", &path))
browser_options.cmdline = CommandLine(FilePath(path)); browser_options.command = CommandLine(FilePath(path));
ListValue* switches = NULL; ListValue* switches = NULL;
const char* kCustomSwitchesKey = "chrome.switches"; const char* kCustomSwitchesKey = "chrome.switches";
...@@ -97,11 +97,11 @@ void CreateSession::ExecutePost(Response* const response) { ...@@ -97,11 +97,11 @@ void CreateSession::ExecutePost(Response* const response) {
kBadRequest, "Custom switch is not a string")); kBadRequest, "Custom switch is not a string"));
return; return;
} }
browser_options.cmdline.AppendSwitchNative( browser_options.command.AppendSwitchNative(
switch_string.substr(0, separator_index), switch_string.substr(0, separator_index),
switch_string_native.substr(separator_index + 1)); switch_string_native.substr(separator_index + 1));
} else { } else {
browser_options.cmdline.AppendSwitch(switch_string); browser_options.command.AppendSwitch(switch_string);
} }
} }
} else if (capabilities->HasKey(kCustomSwitchesKey)) { } else if (capabilities->HasKey(kCustomSwitchesKey)) {
...@@ -130,8 +130,6 @@ void CreateSession::ExecutePost(Response* const response) { ...@@ -130,8 +130,6 @@ void CreateSession::ExecutePost(Response* const response) {
"chrome.channel", &browser_options.channel_id); "chrome.channel", &browser_options.channel_id);
ScopedTempDir temp_profile_dir; ScopedTempDir temp_profile_dir;
FilePath temp_user_data_dir;
std::string base64_profile; std::string base64_profile;
if (capabilities->GetStringWithoutPathExpansion("chrome.profile", if (capabilities->GetStringWithoutPathExpansion("chrome.profile",
&base64_profile)) { &base64_profile)) {
...@@ -148,8 +146,9 @@ void CreateSession::ExecutePost(Response* const response) { ...@@ -148,8 +146,9 @@ void CreateSession::ExecutePost(Response* const response) {
return; return;
} }
temp_user_data_dir = temp_profile_dir.path().AppendASCII("user_data_dir"); browser_options.user_data_dir =
if (!Unzip(temp_profile_zip, temp_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( response->SetError(new Error(
kBadRequest, "Could not unarchive provided user profile")); kBadRequest, "Could not unarchive provided user profile"));
return; 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