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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/download/download_prefs.h" | 8 #include "chrome/browser/download/download_prefs.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "chrome/common/extensions/api/streams_private.h" | 13 #include "chrome/common/extensions/api/streams_private.h" |
14 #include "chrome/common/extensions/manifest_handlers/mime_types_handler.h" | 14 #include "chrome/common/extensions/manifest_handlers/mime_types_handler.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/base/test_switches.h" | 16 #include "chrome/test/base/test_switches.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/download_item.h" | 18 #include "content/public/browser/download_item.h" |
19 #include "content/public/browser/download_manager.h" | 19 #include "content/public/browser/download_manager.h" |
20 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
21 #include "content/public/browser/resource_controller.h" | 21 #include "content/public/browser/resource_controller.h" |
22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
23 #include "content/public/test/download_test_observer.h" | 23 #include "content/public/test/download_test_observer.h" |
24 #include "extensions/browser/event_router.h" | 24 #include "extensions/browser/event_router.h" |
25 #include "extensions/browser/extension_system.h" | 25 #include "extensions/browser/extension_system.h" |
| 26 #include "extensions/test/result_catcher.h" |
26 #include "net/dns/mock_host_resolver.h" | 27 #include "net/dns/mock_host_resolver.h" |
27 #include "net/test/embedded_test_server/embedded_test_server.h" | 28 #include "net/test/embedded_test_server/embedded_test_server.h" |
28 #include "net/test/embedded_test_server/http_request.h" | 29 #include "net/test/embedded_test_server/http_request.h" |
29 #include "net/test/embedded_test_server/http_response.h" | 30 #include "net/test/embedded_test_server/http_response.h" |
30 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
31 | 32 |
32 using content::BrowserContext; | 33 using content::BrowserContext; |
33 using content::BrowserThread; | 34 using content::BrowserThread; |
34 using content::DownloadItem; | 35 using content::DownloadItem; |
35 using content::DownloadManager; | 36 using content::DownloadManager; |
36 using content::DownloadUrlParameters; | 37 using content::DownloadUrlParameters; |
37 using content::ResourceController; | 38 using content::ResourceController; |
38 using content::WebContents; | 39 using content::WebContents; |
39 using extensions::Event; | 40 using extensions::Event; |
40 using extensions::ExtensionSystem; | 41 using extensions::ExtensionSystem; |
| 42 using extensions::ResultCatcher; |
41 using net::test_server::BasicHttpResponse; | 43 using net::test_server::BasicHttpResponse; |
42 using net::test_server::HttpRequest; | 44 using net::test_server::HttpRequest; |
43 using net::test_server::HttpResponse; | 45 using net::test_server::HttpResponse; |
44 using net::test_server::EmbeddedTestServer; | 46 using net::test_server::EmbeddedTestServer; |
45 using testing::_; | 47 using testing::_; |
46 | 48 |
47 namespace streams_private = extensions::api::streams_private; | 49 namespace streams_private = extensions::api::streams_private; |
48 | 50 |
49 namespace { | 51 namespace { |
50 | 52 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 base::MessageLoop::current()->RunUntilIdle(); | 447 base::MessageLoop::current()->RunUntilIdle(); |
446 EXPECT_TRUE(catcher.GetNextResult()); | 448 EXPECT_TRUE(catcher.GetNextResult()); |
447 | 449 |
448 ui_test_utils::NavigateToURL(browser(), | 450 ui_test_utils::NavigateToURL(browser(), |
449 test_server_->GetURL("/abort.rtf")); | 451 test_server_->GetURL("/abort.rtf")); |
450 base::MessageLoop::current()->RunUntilIdle(); | 452 base::MessageLoop::current()->RunUntilIdle(); |
451 EXPECT_TRUE(catcher.GetNextResult()); | 453 EXPECT_TRUE(catcher.GetNextResult()); |
452 } | 454 } |
453 | 455 |
454 } // namespace | 456 } // namespace |
OLD | NEW |