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

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

Issue 14660016: Disables on mac DownloadTest.DownloadTest_PercentComplete as its (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2849 download_item->Cancel(true); 2849 download_item->Cancel(true);
2850 EXPECT_TRUE(download_item->IsCancelled()); 2850 EXPECT_TRUE(download_item->IsCancelled());
2851 } 2851 }
2852 2852
2853 // The Mac downloaded files quarantine feature is implemented by the 2853 // The Mac downloaded files quarantine feature is implemented by the
2854 // Contents/Info.plist file in cocoa apps. browser_tests cannot test 2854 // Contents/Info.plist file in cocoa apps. browser_tests cannot test
2855 // quarantining files on Mac because it is not a cocoa app. 2855 // quarantining files on Mac because it is not a cocoa app.
2856 // TODO(benjhayden) test the equivalents on other platforms. 2856 // TODO(benjhayden) test the equivalents on other platforms.
2857 2857
2858 // Test downloading a huge file and that PercentComplete is monotonic. 2858 // Test downloading a huge file and that PercentComplete is monotonic.
2859 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_PercentComplete) { 2859
2860 // Disable on mac: http://crbug.com/238831
2861 #if defined(OS_MACOSX)
2862 #define MAYBE_DownloadTest_PercentComplete DISABLED_DownloadTest_PercentComplete
2863 #else
2864 #define MAYBE_DownloadTest_PercentComplete DownloadTest_PercentComplete
2865 #endif
2866 IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_DownloadTest_PercentComplete) {
2860 // Write a huge file. 2867 // Write a huge file.
2861 base::FilePath file_path(DestinationFile( 2868 base::FilePath file_path(DestinationFile(
2862 browser(), base::FilePath(FILE_PATH_LITERAL("DownloadTest_BigZip.zip")))); 2869 browser(), base::FilePath(FILE_PATH_LITERAL("DownloadTest_BigZip.zip"))));
2863 int flags = (base::PLATFORM_FILE_CREATE | 2870 int flags = (base::PLATFORM_FILE_CREATE |
2864 base::PLATFORM_FILE_WRITE); 2871 base::PLATFORM_FILE_WRITE);
2865 bool created = false; 2872 bool created = false;
2866 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_MAX; 2873 base::PlatformFileError error = base::PLATFORM_FILE_ERROR_MAX;
2867 base::PlatformFile fd = base::CreatePlatformFile( 2874 base::PlatformFile fd = base::CreatePlatformFile(
2868 file_path, flags, &created, &error); 2875 file_path, flags, &created, &error);
2869 int64 size = 1 << 29; 2876 int64 size = 1 << 29;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 scoped_ptr<content::DownloadTestObserver> observer( 2931 scoped_ptr<content::DownloadTestObserver> observer(
2925 DangerousDownloadWaiter( 2932 DangerousDownloadWaiter(
2926 browser(), 1, 2933 browser(), 1,
2927 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 2934 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
2928 ui_test_utils::NavigateToURL(browser(), url); 2935 ui_test_utils::NavigateToURL(browser(), url);
2929 observer->WaitForFinished(); 2936 observer->WaitForFinished();
2930 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED)); 2937 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED));
2931 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 2938 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
2932 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 2939 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
2933 } 2940 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698