summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/chrome_frame_automation_mock.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 05:06:29 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 05:06:29 +0000
commitf8554294db9c534f2cf4c0069bd705dd490f9d67 (patch)
treedc26caa184546477ee290910832df7a168a46bb3 /chrome_frame/test/chrome_frame_automation_mock.h
parentd2177996db8711c972258e43d70ed90252170441 (diff)
downloadchromium_src-f8554294db9c534f2cf4c0069bd705dd490f9d67.zip
chromium_src-f8554294db9c534f2cf4c0069bd705dd490f9d67.tar.gz
chromium_src-f8554294db9c534f2cf4c0069bd705dd490f9d67.tar.bz2
ChromeFrame tests now use the mock http server instead of the python web server. This allows
us to control the behavior of the http server in the future. The change in the \chrome_frame_tester_helpers.js file is to send over asynchronous XHR post requests to prevent the browser from blocking in the UI thread while waiting for a response. We copy the the CFInstall and CFInstance scripts to the test\data folder to enable the mock server to serve them. Added support for the /echoheader? based GET requests. Some ChromeFrame tests rely on this. Bug=54908 Review URL: http://codereview.chromium.org/3356013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/chrome_frame_automation_mock.h')
-rw-r--r--chrome_frame/test/chrome_frame_automation_mock.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h
index bc7e3e5..b080bea 100644
--- a/chrome_frame/test/chrome_frame_automation_mock.h
+++ b/chrome_frame/test/chrome_frame_automation_mock.h
@@ -13,6 +13,7 @@
#include "chrome_frame/chrome_frame_plugin.h"
#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
+#include "chrome_frame/test/test_with_web_server.h"
#include "chrome_frame/utils.h"
template <typename T>
@@ -26,8 +27,11 @@ class AutomationMockDelegate
const std::wstring& extra_chrome_arguments, bool incognito,
bool is_widget_mode)
: caller_message_loop_(caller_message_loop), is_connected_(false),
- navigation_result_(false) {
- test_server_.SetUp();
+ navigation_result_(false),
+ mock_server_(1337, L"127.0.0.1",
+ chrome_frame_test::GetTestDataFolder()) {
+
+ mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE));
FilePath profile_path(
chrome_frame_test::GetProfilePath(profile_name));
@@ -48,8 +52,6 @@ class AutomationMockDelegate
}
if (IsWindow())
DestroyWindow();
-
- test_server_.TearDown();
}
// Navigate external tab to the specified url through automation
@@ -76,7 +78,7 @@ class AutomationMockDelegate
}
bool NavigateRelative(const std::wstring& relative_url) {
- return Navigate(test_server_.Resolve(relative_url.c_str()).spec());
+ return Navigate(WideToUTF8(mock_server_.Resolve(relative_url.c_str())));
}
virtual void OnAutomationServerReady() {
@@ -130,7 +132,7 @@ class AutomationMockDelegate
}
private:
- ChromeFrameHTTPServer test_server_;
+ testing::StrictMock<MockWebServer> mock_server_;
MessageLoop* caller_message_loop_;
GURL url_;
bool is_connected_;