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 "chrome/browser/download/download_browsertest.h" | 5 #include "chrome/browser/download/download_browsertest.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 ASSERT_TRUE(InitialSetup()); | 430 ASSERT_TRUE(InitialSetup()); |
431 } | 431 } |
432 | 432 |
433 void TearDownOnMainThread() override { | 433 void TearDownOnMainThread() override { |
434 // Needs to be torn down on the main thread. file_activity_observer_ holds a | 434 // Needs to be torn down on the main thread. file_activity_observer_ holds a |
435 // reference to the ChromeDownloadManagerDelegate which should be destroyed | 435 // reference to the ChromeDownloadManagerDelegate which should be destroyed |
436 // on the UI thread. | 436 // on the UI thread. |
437 file_activity_observer_.reset(); | 437 file_activity_observer_.reset(); |
438 } | 438 } |
439 | 439 |
440 void SetUpCommandLine(base::CommandLine* command_line) override { | |
441 command_line->AppendSwitch(switches::kDisablePluginsDiscovery); | |
442 } | |
443 | |
444 // Returning false indicates a failure of the setup, and should be asserted | 440 // Returning false indicates a failure of the setup, and should be asserted |
445 // in the caller. | 441 // in the caller. |
446 virtual bool InitialSetup() { | 442 virtual bool InitialSetup() { |
447 bool have_test_dir = PathService::Get(chrome::DIR_TEST_DATA, &test_dir_); | 443 bool have_test_dir = PathService::Get(chrome::DIR_TEST_DATA, &test_dir_); |
448 EXPECT_TRUE(have_test_dir); | 444 EXPECT_TRUE(have_test_dir); |
449 if (!have_test_dir) | 445 if (!have_test_dir) |
450 return false; | 446 return false; |
451 | 447 |
452 // Sanity check default values for window and tab count. | 448 // Sanity check default values for window and tab count. |
453 int window_count = chrome::GetTotalBrowserCount(); | 449 int window_count = chrome::GetTotalBrowserCount(); |
(...skipping 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3668 | 3664 |
3669 scoped_ptr<content::DownloadTestObserver> observer(DangerousDownloadWaiter( | 3665 scoped_ptr<content::DownloadTestObserver> observer(DangerousDownloadWaiter( |
3670 browser(), 1, content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); | 3666 browser(), 1, content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); |
3671 ui_test_utils::NavigateToURL(browser(), extension_url); | 3667 ui_test_utils::NavigateToURL(browser(), extension_url); |
3672 | 3668 |
3673 observer->WaitForFinished(); | 3669 observer->WaitForFinished(); |
3674 | 3670 |
3675 // Download shelf should close. | 3671 // Download shelf should close. |
3676 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 3672 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
3677 } | 3673 } |
OLD | NEW |