| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ | 5 #ifndef CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ |
| 6 #define CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ | 6 #define CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // 4) Supports read the posted results from the test webpage to the "dump" | 145 // 4) Supports read the posted results from the test webpage to the "dump" |
| 146 // webserver directory | 146 // webserver directory |
| 147 class ChromeFrameTestWithWebServer : public testing::Test { | 147 class ChromeFrameTestWithWebServer : public testing::Test { |
| 148 public: | 148 public: |
| 149 ChromeFrameTestWithWebServer(); | 149 ChromeFrameTestWithWebServer(); |
| 150 | 150 |
| 151 protected: | 151 protected: |
| 152 enum BrowserKind { INVALID, IE, CHROME }; | 152 enum BrowserKind { INVALID, IE, CHROME }; |
| 153 | 153 |
| 154 bool LaunchBrowser(BrowserKind browser, const wchar_t* url); | 154 bool LaunchBrowser(BrowserKind browser, const wchar_t* url); |
| 155 bool WaitForTestToComplete(int milliseconds); | 155 bool WaitForTestToComplete(base::TimeDelta duration); |
| 156 |
| 156 // Waits for the page to notify us of the window.onload event firing. | 157 // Waits for the page to notify us of the window.onload event firing. |
| 157 // Note that the milliseconds value is only approximate. | 158 // Note that the milliseconds value is only approximate. |
| 158 bool WaitForOnLoad(int milliseconds); | 159 bool WaitForOnLoad(int milliseconds); |
| 159 | 160 |
| 160 // Launches the specified browser and waits for the test to complete | 161 // Launches the specified browser and waits for the test to complete |
| 161 // (see WaitForTestToComplete). Then checks that the outcome is equal | 162 // (see WaitForTestToComplete). Then checks that the outcome is equal |
| 162 // to the expected result. | 163 // to the expected result. |
| 163 // This function uses EXPECT_TRUE and ASSERT_TRUE for all steps performed | 164 // This function uses EXPECT_TRUE and ASSERT_TRUE for all steps performed |
| 164 // hence no return value. | 165 // hence no return value. |
| 165 void SimpleBrowserTestExpectedResult(BrowserKind browser, | 166 void SimpleBrowserTestExpectedResult(BrowserKind browser, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // Same as above except that the response does not include the no-cache header. | 314 // Same as above except that the response does not include the no-cache header. |
| 314 ACTION_P2(SendAllowCacheResponse, server, invocation) { | 315 ACTION_P2(SendAllowCacheResponse, server, invocation) { |
| 315 server->SendResponseHelper(arg0, arg1, invocation, false); | 316 server->SendResponseHelper(arg0, arg1, invocation, false); |
| 316 } | 317 } |
| 317 | 318 |
| 318 ACTION_P2(HandlePostedResponseHelper, server, invocation) { | 319 ACTION_P2(HandlePostedResponseHelper, server, invocation) { |
| 319 server->HandlePostedResponse(arg0, arg2); | 320 server->HandlePostedResponse(arg0, arg2); |
| 320 } | 321 } |
| 321 | 322 |
| 322 #endif // CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ | 323 #endif // CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_ |
| OLD | NEW |