summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:59:38 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:59:38 +0000
commit060e9ddba52b3ac3704bbdcfc1c755e53b695e1b (patch)
tree24e5c75523302405922d7c7a99652c713fbc55c7 /chrome_frame
parent09a9da72051e7543bd800167c88e5d56c523b5fe (diff)
downloadchromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.zip
chromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.tar.gz
chromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.tar.bz2
Revert 66840 - Add named testing interface. This allows you to connect to a pre-existing Chrome process and run tests on it. This is an addition to the low level interface underlying testing frameworks like PyAuto and WebDriver.
Normally, test frameworks communicate with Chrome over an unnamed socket pair on POSIX. The test creates the socket pair and then launches the browser as a child process, passing an open file descriptor for one end of the socket to the browser. This change adds a command line switch that, when passed to the browser, causes it to listen on a named socket instead, eliminating this parent/child process requirement. Therefore, you can potentially connect any number of tests to a preexisting browser process. For ChromeOS, this allows you to run tests on the instance of Chrome that is launched on startup, which controls things like the login and lock screens, the battery meter, the wireless UI, etc. Currently there is no way to run tests on a pre-existing Chrome instance. Eventually this will also allow you to connect both PyAuto and WebDriver to the same Chrome instance and run both in the same test. If you pass the browser the following command line switch: ./chrome --testing-channel=NamedTestingInterface:/path/to/file This causes the browser to listen for incoming connections. An AutomationProxy can connect to the browser by connecting a Unix domain socket to the specified path and control the browser over the socket. This is currently only for POSIX. Windows support will come in a future change. Also, this initial change only allows one connection; multiple connection support will come in a future change. BUG=chromium-os:8512 TEST=Run Chrome with --testing-interface=/var/tmp/NamedTestingInterface, then run NamedInterfaceTest.BasicNamedInterface under ui_tests. Review URL: http://codereview.chromium.org/4202004 TBR=nirnimesh@chromium.org Review URL: http://codereview.chromium.org/5177007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame.gyp9
-rw-r--r--chrome_frame/chrome_frame_automation.cc11
-rw-r--r--chrome_frame/chrome_frame_automation.h1
-rw-r--r--chrome_frame/test/automation_client_mock.cc4
-rw-r--r--chrome_frame/test/net/test_automation_provider.cc2
5 files changed, 9 insertions, 18 deletions
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp
index 8db3abd..0cfe895 100644
--- a/chrome_frame/chrome_frame.gyp
+++ b/chrome_frame/chrome_frame.gyp
@@ -335,7 +335,7 @@
},
},
'dependencies': [
- '../chrome/chrome.gyp:crash_service',
+ '../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:automation',
'../chrome/chrome.gyp:installer_util',
'../google_update/google_update.gyp:google_update',
@@ -429,7 +429,7 @@
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_handler',
'../chrome/chrome.gyp:automation',
- '../chrome/chrome.gyp:crash_service',
+ '../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:installer_util',
'../google_update/google_update.gyp:google_update',
],
@@ -497,7 +497,7 @@
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_handler',
'../chrome/chrome.gyp:automation',
- '../chrome/chrome.gyp:crash_service',
+ '../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:chrome_dll_version',
'../chrome/chrome.gyp:installer_util',
'../google_update/google_update.gyp:google_update',
@@ -550,10 +550,7 @@
'test/win_event_receiver.h',
'chrome_tab.h',
'../base/test/test_file_util_win.cc',
- '../chrome/test/automation/proxy_launcher.cc',
- '../chrome/test/automation/proxy_launcher.h',
'../chrome/test/ui/ui_test.cc',
- '../chrome/test/ui/ui_test.h',
'../chrome/test/ui/ui_test_suite.cc',
'../chrome/test/ui/ui_test_suite.h',
'../chrome/test/chrome_process_util.cc',
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 94d30b8..7a49f18 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -144,13 +144,10 @@ class ChromeFrameAutomationProxyImpl::CFMsgDispatcher
};
ChromeFrameAutomationProxyImpl::ChromeFrameAutomationProxyImpl(
- AutomationProxyCacheEntry* entry,
- std::string channel_id, int launch_timeout)
+ AutomationProxyCacheEntry* entry, int launch_timeout)
: AutomationProxy(launch_timeout, false), proxy_entry_(entry) {
TRACE_EVENT_BEGIN("chromeframe.automationproxy", this, "");
- InitializeChannel(channel_id, false);
-
sync_ = new CFMsgDispatcher();
message_filter_ = new TabProxyNotificationMessageFilter(tracker_.get());
@@ -274,10 +271,8 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params,
// destruction notification.
// At same time we must destroy/stop the thread from another thread.
- std::string channel_id = AutomationProxy::GenerateChannelID();
ChromeFrameAutomationProxyImpl* proxy =
- new ChromeFrameAutomationProxyImpl(this, channel_id,
- params->launch_timeout());
+ new ChromeFrameAutomationProxyImpl(this, params->launch_timeout());
// Ensure that the automation proxy actually respects our choice on whether
// or not to check the version.
@@ -287,7 +282,7 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params,
scoped_ptr<CommandLine> command_line(
chrome_launcher::CreateLaunchCommandLine());
command_line->AppendSwitchASCII(switches::kAutomationClientChannelID,
- channel_id);
+ proxy->channel_id());
// Run Chrome in Chrome Frame mode. In practice, this modifies the paths
// and registry keys that Chrome looks in via the BrowserDistribution
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h
index 5cf1304..cb1b282 100644
--- a/chrome_frame/chrome_frame_automation.h
+++ b/chrome_frame/chrome_frame_automation.h
@@ -92,7 +92,6 @@ class ChromeFrameAutomationProxyImpl
protected:
friend class AutomationProxyCacheEntry;
ChromeFrameAutomationProxyImpl(AutomationProxyCacheEntry* entry,
- std::string channel_id,
int launch_timeout);
class CFMsgDispatcher;
diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc
index 2cf981b..7e8f317 100644
--- a/chrome_frame/test/automation_client_mock.cc
+++ b/chrome_frame/test/automation_client_mock.cc
@@ -315,8 +315,7 @@ class TestChromeFrameAutomationProxyImpl
public:
TestChromeFrameAutomationProxyImpl()
// 1 is an unneeded timeout.
- : ChromeFrameAutomationProxyImpl(
- NULL, AutomationProxy::GenerateChannelID(), 1) {
+ : ChromeFrameAutomationProxyImpl(NULL, 1) {
}
MOCK_METHOD3(
SendAsAsync,
@@ -470,3 +469,4 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) {
EXPECT_CALL(mock_proxy_, ReleaseTabProxy(testing::Eq(tab_handle_))).Times(1);
client_->Uninitialize();
}
+
diff --git a/chrome_frame/test/net/test_automation_provider.cc b/chrome_frame/test/net/test_automation_provider.cc
index d6a0676..5b8a9a6 100644
--- a/chrome_frame/test/net/test_automation_provider.cc
+++ b/chrome_frame/test/net/test_automation_provider.cc
@@ -119,7 +119,7 @@ TestAutomationProvider* TestAutomationProvider::NewAutomationProvider(
Profile* p, const std::string& channel,
TestAutomationProviderDelegate* delegate) {
TestAutomationProvider* automation = new TestAutomationProvider(p, delegate);
- automation->InitializeChannel(channel);
+ automation->ConnectToChannel(channel);
automation->SetExpectedTabCount(1);
return automation;
}