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 #include "base/string_util.h" | 5 #include "base/string_util.h" |
6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 url, net::CookieOptions(), | 49 url, net::CookieOptions(), |
50 base::Bind(&GetCookiesCallback, | 50 base::Bind(&GetCookiesCallback, |
51 base::Unretained(cookies), base::Unretained(event))); | 51 base::Unretained(cookies), base::Unretained(event))); |
52 } | 52 } |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
56 class ResourceDispatcherHostBrowserTest : public InProcessBrowserTest, | 56 class ResourceDispatcherHostBrowserTest : public InProcessBrowserTest, |
57 public DownloadManager::Observer { | 57 public DownloadManager::Observer { |
58 public: | 58 public: |
59 ResourceDispatcherHostBrowserTest() : got_downloads_(false) { | 59 ResourceDispatcherHostBrowserTest() : got_downloads_(false) {} |
60 EnableDOMAutomation(); | |
61 } | |
62 | 60 |
63 protected: | 61 protected: |
64 virtual void SetUpOnMainThread() OVERRIDE { | 62 virtual void SetUpOnMainThread() OVERRIDE { |
65 FilePath path = ui_test_utils::GetTestFilePath(FilePath(), FilePath()); | 63 FilePath path = ui_test_utils::GetTestFilePath(FilePath(), FilePath()); |
66 BrowserThread::PostTask( | 64 BrowserThread::PostTask( |
67 BrowserThread::IO, FROM_HERE, | 65 BrowserThread::IO, FROM_HERE, |
68 base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, path)); | 66 base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, path)); |
69 BrowserThread::PostTask( | 67 BrowserThread::PostTask( |
70 BrowserThread::IO, FROM_HERE, | 68 BrowserThread::IO, FROM_HERE, |
71 base::Bind(&URLRequestFailedJob::AddUrlHandler)); | 69 base::Bind(&URLRequestFailedJob::AddUrlHandler)); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 459 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
462 CrossSiteFailedRequest) { | 460 CrossSiteFailedRequest) { |
463 // Visit another URL first to trigger a cross-site navigation. | 461 // Visit another URL first to trigger a cross-site navigation. |
464 GURL url(chrome::kTestNewTabURL); | 462 GURL url(chrome::kTestNewTabURL); |
465 ui_test_utils::NavigateToURL(browser(), url); | 463 ui_test_utils::NavigateToURL(browser(), url); |
466 | 464 |
467 // Visit a URL that fails without calling ResourceDispatcherHost::Read. | 465 // Visit a URL that fails without calling ResourceDispatcherHost::Read. |
468 GURL broken_url("chrome://theme"); | 466 GURL broken_url("chrome://theme"); |
469 CheckTitleTest(broken_url, "chrome://theme/ is not available", 1); | 467 CheckTitleTest(broken_url, "chrome://theme/ is not available", 1); |
470 } | 468 } |
OLD | NEW |