Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: chrome/browser/errorpage_uitest.cc

Issue 17030: Revert 7508.7509 and 7510 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_uitest.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/string_util.h" 5 #include "base/string_util.h"
6 #include "chrome/test/ui/ui_test.h" 6 #include "chrome/test/ui/ui_test.h"
7 #include "chrome/browser/automation/url_request_failed_dns_job.h" 7 #include "chrome/browser/automation/url_request_failed_dns_job.h"
8 #include "net/url_request/url_request_unittest.h" 8 #include "net/url_request/url_request_unittest.h"
9 9
10 class ErrorPageTest : public UITest { 10 class ErrorPageTest : public UITest {
(...skipping 20 matching lines...) Expand all
31 if (i == 10) { 31 if (i == 10) {
32 FAIL() << "failed to get error page title; got " << title; 32 FAIL() << "failed to get error page title; got " << title;
33 } 33 }
34 }; 34 };
35 35
36 TEST_F(ErrorPageTest, IFrame404) { 36 TEST_F(ErrorPageTest, IFrame404) {
37 // iframes that have 404 pages should not trigger an alternate error page. 37 // iframes that have 404 pages should not trigger an alternate error page.
38 // In this test, the iframe sets the title of the parent page to "SUCCESS" 38 // In this test, the iframe sets the title of the parent page to "SUCCESS"
39 // when the iframe loads. If the iframe fails to load (because an alternate 39 // when the iframe loads. If the iframe fails to load (because an alternate
40 // error page loads instead), then the title will remain as "FAIL". 40 // error page loads instead), then the title will remain as "FAIL".
41 scoped_refptr<HTTPTestServer> server = 41 TestServer server(L"chrome/test/data");
42 HTTPTestServer::CreateServer(L"chrome/test/data"); 42 GURL test_url = server.TestServerPage("files/iframe404.html");
43 ASSERT_TRUE(NULL != server.get());
44 GURL test_url = server->TestServerPage("files/iframe404.html");
45 NavigateToURL(test_url); 43 NavigateToURL(test_url);
46 44
47 // Verify that the url is in the title. Since it's set via Javascript, we 45 // Verify that the url is in the title. Since it's set via Javascript, we
48 // need to give it a chance to run. 46 // need to give it a chance to run.
49 int i; 47 int i;
50 std::wstring title; 48 std::wstring title;
51 for (i = 0; i < 10; ++i) { 49 for (i = 0; i < 10; ++i) {
52 Sleep(kWaitForActionMaxMsec / 10); 50 Sleep(kWaitForActionMaxMsec / 10);
53 title = GetActiveTabTitle(); 51 title = GetActiveTabTitle();
54 if (title == L"SUCCESS") { 52 if (title == L"SUCCESS") {
55 // Success, bail out. 53 // Success, bail out.
56 break; 54 break;
57 } 55 }
58 } 56 }
59 57
60 if (i == 10) { 58 if (i == 10) {
61 FAIL() << "iframe 404 didn't load properly"; 59 FAIL() << "iframe 404 didn't load properly";
62 } 60 }
63 }; 61 };
OLDNEW
« no previous file with comments | « chrome/browser/browser_uitest.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698