summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-01 01:38:59 +0000
committerslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-01 01:38:59 +0000
commit43c698f773c0bbcf87b5486fbc4d2fbcb7a24dae (patch)
treefe9fa68354573cf9c6a00dd220a6096e81e58c45 /chrome_frame/test
parentc664beb3d7ae2676c35db44d14eadd4b75c21164 (diff)
downloadchromium_src-43c698f773c0bbcf87b5486fbc4d2fbcb7a24dae.zip
chromium_src-43c698f773c0bbcf87b5486fbc4d2fbcb7a24dae.tar.gz
chromium_src-43c698f773c0bbcf87b5486fbc4d2fbcb7a24dae.tar.bz2
Test for GCF install flow auto-patching.
BUG=42790 TEST=run chrome_frame_tests.exe --gtest_filter=*InstallFlow* Review URL: http://codereview.chromium.org/1727018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/data/install_flow_test.html36
-rw-r--r--chrome_frame/test/data/install_flow_test_finish.html30
-rw-r--r--chrome_frame/test/test_with_web_server.cc24
3 files changed, 90 insertions, 0 deletions
diff --git a/chrome_frame/test/data/install_flow_test.html b/chrome_frame/test/data/install_flow_test.html
new file mode 100644
index 0000000..f61dfc94
--- /dev/null
+++ b/chrome_frame/test/data/install_flow_test.html
@@ -0,0 +1,36 @@
+<html>
+ <head>
+ <title>install flow test</title>
+ <script type="text/javascript"
+ src="chrome_frame_tester_helpers.js"></script>
+ <script type="text/javascript"
+ src="CFInstall.js"></script>
+ </head>
+ <body>
+ <div id="statusPanel" style="border: 1px solid red; width: 100%">
+ Test running....
+ </div>
+ <script type="text/javascript">
+ var testName = 'FullTab_InstallFlowTest';
+ (function(){
+ try{
+ if (CFInstall.isAvailable()) {
+ onFailure(testName, 1, 'plugin registered ahead of install test');
+ } else {
+ appendStatus("Waiting for install to complete...");
+ var timer = setInterval(function() {
+ if (CFInstall.isAvailable()) {
+ clearInterval(timer);
+ appendStatus("Installed! Redirecting...");
+ location.href = "/files/install_flow_test_finish.html";
+ }
+ }, 1000);
+ }
+ } catch (e) {
+ onFailure(testName, 1,
+ 'install flow test failed with error: '+e);
+ }
+ })();
+ </script>
+ </body>
+</html>
diff --git a/chrome_frame/test/data/install_flow_test_finish.html b/chrome_frame/test/data/install_flow_test_finish.html
new file mode 100644
index 0000000..5ab8797
--- /dev/null
+++ b/chrome_frame/test/data/install_flow_test_finish.html
@@ -0,0 +1,30 @@
+<html>
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
+ <title>install flow test</title>
+ <script type="text/javascript"
+ src="chrome_frame_tester_helpers.js"></script>
+ <script type="text/javascript"
+ src="CFInstall.js"></script>
+ </head>
+ <body>
+ <div id="statusPanel" style="border: 1px solid red; width: 100%">
+ Test running....
+ </div>
+ <script type="text/javascript">
+ var testName = 'FullTab_InstallFlowTest';
+ (function(){
+ try{
+ if (!isRunningInChrome()) {
+ onFailure(testName, 1, 'bho switch failed');
+ } else {
+ onSuccess(testName, 1);
+ }
+ } catch(e) {
+ onFailure(testName, 1,
+ 'install flow test end failed with error: '+e);
+ }
+ })();
+ </script>
+ </body>
+</html>
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index 218fc97..29b3988 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -4,6 +4,7 @@
#include "chrome_frame/test/test_with_web_server.h"
#include "base/file_version_info.h"
+#include "base/win_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/helper.h"
@@ -726,6 +727,29 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_XHRTest) {
ASSERT_TRUE(CheckResultFile(L"FullTab_XMLHttpRequestTest", "OK"));
}
+const wchar_t kInstallFlowTestUrl[] =
+ L"files/install_flow_test.html";
+
+TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) {
+ if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) {
+ chrome_frame_test::TimedMsgLoop loop;
+ ScopedChromeFrameRegistrar::UnregisterAtPath(
+ ScopedChromeFrameRegistrar::GetChromeFrameBuildPath().value());
+
+ ASSERT_TRUE(LaunchBrowser(IE, kInstallFlowTestUrl));
+
+ loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+
+ ScopedChromeFrameRegistrar::RegisterAtPath(
+ ScopedChromeFrameRegistrar::GetChromeFrameBuildPath().value());
+
+ loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+
+ chrome_frame_test::CloseAllIEWindows();
+ ASSERT_TRUE(CheckResultFile(L"FullTab_InstallFlowTest", "OK"));
+ }
+}
+
const wchar_t kMultipleCFInstancesTestUrl[] =
L"files/multiple_cf_instances_main.html";