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 <list> | 5 #include <list> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/threading/thread_restrictions.h" |
16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
17 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
18 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chrome_browser_main.h" | 20 #include "chrome/browser/chrome_browser_main.h" |
20 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 21 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
21 #include "chrome/browser/chrome_content_browser_client.h" | 22 #include "chrome/browser/chrome_content_browser_client.h" |
22 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
23 #include "chrome/browser/download/download_browsertest.h" | 24 #include "chrome/browser/download/download_browsertest.h" |
24 #include "chrome/browser/download/download_prefs.h" | 25 #include "chrome/browser/download/download_prefs.h" |
25 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 26 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 400 } |
400 | 401 |
401 // http://crbug.com/660288 | 402 // http://crbug.com/660288 |
402 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, DISABLED_ServerRedirect) { | 403 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, DISABLED_ServerRedirect) { |
403 ASSERT_TRUE(StartEmbeddedTestServer()); | 404 ASSERT_TRUE(StartEmbeddedTestServer()); |
404 ASSERT_TRUE(RunExtensionTest("webnavigation/serverRedirect")) | 405 ASSERT_TRUE(RunExtensionTest("webnavigation/serverRedirect")) |
405 << message_; | 406 << message_; |
406 } | 407 } |
407 | 408 |
408 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) { | 409 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) { |
| 410 base::ThreadRestrictions::ScopedAllowIO allow_io; |
409 base::ScopedTempDir download_directory; | 411 base::ScopedTempDir download_directory; |
410 ASSERT_TRUE(download_directory.CreateUniqueTempDir()); | 412 ASSERT_TRUE(download_directory.CreateUniqueTempDir()); |
411 DownloadPrefs* download_prefs = | 413 DownloadPrefs* download_prefs = |
412 DownloadPrefs::FromBrowserContext(browser()->profile()); | 414 DownloadPrefs::FromBrowserContext(browser()->profile()); |
413 download_prefs->SetDownloadPath(download_directory.GetPath()); | 415 download_prefs->SetDownloadPath(download_directory.GetPath()); |
414 | 416 |
415 DownloadTestObserverNotInProgress download_observer( | 417 DownloadTestObserverNotInProgress download_observer( |
416 content::BrowserContext::GetDownloadManager(profile()), 1); | 418 content::BrowserContext::GetDownloadManager(profile()), 1); |
417 download_observer.StartObserving(); | 419 download_observer.StartObserving(); |
418 ASSERT_TRUE(StartEmbeddedTestServer()); | 420 ASSERT_TRUE(StartEmbeddedTestServer()); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 "extensions/api_test/webnavigation/crash/b.html", | 809 "extensions/api_test/webnavigation/crash/b.html", |
808 embedded_test_server()->port())); | 810 embedded_test_server()->port())); |
809 ui_test_utils::NavigateToURL(browser(), url); | 811 ui_test_utils::NavigateToURL(browser(), url); |
810 | 812 |
811 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 813 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
812 } | 814 } |
813 | 815 |
814 #endif | 816 #endif |
815 | 817 |
816 } // namespace extensions | 818 } // namespace extensions |
OLD | NEW |