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

Side by Side Diff: chrome/browser/download/download_browsertest.cc

Issue 1365963004: Don't compile download notification code on !CrOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: images and strings Created 5 years, 2 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
OLDNEW
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 <sstream> 5 #include <sstream>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 19 matching lines...) Expand all
30 #include "chrome/browser/download/download_crx_util.h" 30 #include "chrome/browser/download/download_crx_util.h"
31 #include "chrome/browser/download/download_history.h" 31 #include "chrome/browser/download/download_history.h"
32 #include "chrome/browser/download/download_item_model.h" 32 #include "chrome/browser/download/download_item_model.h"
33 #include "chrome/browser/download/download_prefs.h" 33 #include "chrome/browser/download/download_prefs.h"
34 #include "chrome/browser/download/download_request_limiter.h" 34 #include "chrome/browser/download/download_request_limiter.h"
35 #include "chrome/browser/download/download_service.h" 35 #include "chrome/browser/download/download_service.h"
36 #include "chrome/browser/download/download_service_factory.h" 36 #include "chrome/browser/download/download_service_factory.h"
37 #include "chrome/browser/download/download_shelf.h" 37 #include "chrome/browser/download/download_shelf.h"
38 #include "chrome/browser/download/download_target_determiner.h" 38 #include "chrome/browser/download/download_target_determiner.h"
39 #include "chrome/browser/download/download_test_file_activity_observer.h" 39 #include "chrome/browser/download/download_test_file_activity_observer.h"
40 #include "chrome/browser/download/notification/download_notification_manager.h"
41 #include "chrome/browser/extensions/extension_install_prompt.h" 40 #include "chrome/browser/extensions/extension_install_prompt.h"
42 #include "chrome/browser/extensions/extension_install_prompt_show_params.h" 41 #include "chrome/browser/extensions/extension_install_prompt_show_params.h"
43 #include "chrome/browser/extensions/extension_service.h" 42 #include "chrome/browser/extensions/extension_service.h"
44 #include "chrome/browser/history/history_service_factory.h" 43 #include "chrome/browser/history/history_service_factory.h"
45 #include "chrome/browser/infobars/infobar_service.h" 44 #include "chrome/browser/infobars/infobar_service.h"
46 #include "chrome/browser/net/url_request_mock_util.h" 45 #include "chrome/browser/net/url_request_mock_util.h"
47 #include "chrome/browser/profiles/profile.h" 46 #include "chrome/browser/profiles/profile.h"
48 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert est_util.h" 47 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert est_util.h"
49 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" 48 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h"
50 #include "chrome/browser/ui/browser.h" 49 #include "chrome/browser/ui/browser.h"
(...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after
3385 download_protection_service->feedback_service()->BeginFeedbackForDownload( 3384 download_protection_service->feedback_service()->BeginFeedbackForDownload(
3386 downloads[0]); 3385 downloads[0]);
3387 std::vector<DownloadItem*> updated_downloads; 3386 std::vector<DownloadItem*> updated_downloads;
3388 GetDownloads(browser(), &updated_downloads); 3387 GetDownloads(browser(), &updated_downloads);
3389 ASSERT_TRUE(updated_downloads.empty()); 3388 ASSERT_TRUE(updated_downloads.empty());
3390 } 3389 }
3391 #endif 3390 #endif
3392 3391
3393 class DownloadTestWithShelf : public DownloadTest { 3392 class DownloadTestWithShelf : public DownloadTest {
3394 void SetUpCommandLine(base::CommandLine* command_line) override { 3393 void SetUpCommandLine(base::CommandLine* command_line) override {
3394 #if defined(OS_CHROMEOS)
3395 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification, 3395 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification,
3396 "disabled"); 3396 "disabled");
3397 #endif
3397 DownloadTest::SetUpCommandLine(command_line); 3398 DownloadTest::SetUpCommandLine(command_line);
3398 } 3399 }
3399 }; 3400 };
3400 3401
3401 // Test that the download shelf is shown by starting a download. 3402 // Test that the download shelf is shown by starting a download.
3402 IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, DownloadAndWait) { 3403 IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, DownloadAndWait) {
3403 GURL url = net::URLRequestMockHTTPJob::GetMockUrl("downloads/a_zip_file.zip"); 3404 GURL url = net::URLRequestMockHTTPJob::GetMockUrl("downloads/a_zip_file.zip");
3404 DownloadAndWait(browser(), url); 3405 DownloadAndWait(browser(), url);
3405 3406
3406 // The download shelf should be visible. 3407 // The download shelf should be visible.
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
3646 3647
3647 scoped_ptr<content::DownloadTestObserver> observer(DangerousDownloadWaiter( 3648 scoped_ptr<content::DownloadTestObserver> observer(DangerousDownloadWaiter(
3648 browser(), 1, content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 3649 browser(), 1, content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
3649 ui_test_utils::NavigateToURL(browser(), extension_url); 3650 ui_test_utils::NavigateToURL(browser(), extension_url);
3650 3651
3651 observer->WaitForFinished(); 3652 observer->WaitForFinished();
3652 3653
3653 // Download shelf should close. 3654 // Download shelf should close.
3654 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 3655 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
3655 } 3656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698