OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome_frame/test/test_with_web_server.h" | 5 #include "chrome_frame/test/test_with_web_server.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 results_dir_.AppendASCII("dump"); | 108 results_dir_.AppendASCII("dump"); |
109 | 109 |
110 // Copy the CFInstance.js and CFInstall.js files from src\chrome_frame to | 110 // Copy the CFInstance.js and CFInstall.js files from src\chrome_frame to |
111 // src\chrome_frame\test\data. | 111 // src\chrome_frame\test\data. |
112 FilePath CFInstance_src_path; | 112 FilePath CFInstance_src_path; |
113 FilePath CFInstall_src_path; | 113 FilePath CFInstall_src_path; |
114 | 114 |
115 CFInstance_src_path = chrome_frame_source_path.AppendASCII("CFInstance.js"); | 115 CFInstance_src_path = chrome_frame_source_path.AppendASCII("CFInstance.js"); |
116 CFInstance_path_ = test_file_path_.AppendASCII("CFInstance.js"); | 116 CFInstance_path_ = test_file_path_.AppendASCII("CFInstance.js"); |
117 | 117 |
118 file_util::CopyFileW(CFInstance_src_path, CFInstance_path_); | 118 ASSERT_TRUE(file_util::CopyFile(CFInstance_src_path, CFInstance_path_)); |
119 | 119 |
120 CFInstall_src_path = chrome_frame_source_path.AppendASCII("CFInstall.js"); | 120 CFInstall_src_path = chrome_frame_source_path.AppendASCII("CFInstall.js"); |
121 CFInstall_path_ = test_file_path_.AppendASCII("CFInstall.js"); | 121 CFInstall_path_ = test_file_path_.AppendASCII("CFInstall.js"); |
122 | 122 |
123 file_util::CopyFileW(CFInstall_src_path, CFInstall_path_); | 123 ASSERT_TRUE(file_util::CopyFile(CFInstall_src_path, CFInstall_path_)); |
124 | 124 |
125 server_mock_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE)); | 125 server_mock_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE)); |
126 server_mock_.set_expected_result("OK"); | 126 server_mock_.set_expected_result("OK"); |
127 } | 127 } |
128 | 128 |
129 void ChromeFrameTestWithWebServer::TearDown() { | 129 void ChromeFrameTestWithWebServer::TearDown() { |
130 CloseBrowser(); | 130 CloseBrowser(); |
131 CloseAllBrowsers(); | 131 CloseAllBrowsers(); |
132 file_util::Delete(CFInstall_path_, false); | 132 file_util::Delete(CFInstall_path_, false); |
133 file_util::Delete(CFInstance_path_, false); | 133 file_util::Delete(CFInstance_path_, false); |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 server.web_server()->AddResponse(response); | 1002 server.web_server()->AddResponse(response); |
1003 | 1003 |
1004 std::wstring url(server.FormatHttpPath(L"form.html")); | 1004 std::wstring url(server.FormatHttpPath(L"form.html")); |
1005 | 1005 |
1006 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1006 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
1007 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1007 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
1008 | 1008 |
1009 EXPECT_EQ(1, response->get_request_count()); | 1009 EXPECT_EQ(1, response->get_request_count()); |
1010 EXPECT_EQ(1, response->post_request_count()); | 1010 EXPECT_EQ(1, response->post_request_count()); |
1011 } | 1011 } |
OLD | NEW |