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

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

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h"
10 #include "base/path_service.h" 11 #include "base/path_service.h"
11 #include "base/scoped_temp_dir.h"
12 #include "base/test/test_file_util.h" 12 #include "base/test/test_file_util.h"
13 #include "chrome/app/chrome_command_ids.h" 13 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/browser/api/prefs/pref_member.h" 14 #include "chrome/browser/api/prefs/pref_member.h"
15 #include "chrome/browser/download/chrome_download_manager_delegate.h" 15 #include "chrome/browser/download/chrome_download_manager_delegate.h"
16 #include "chrome/browser/download/download_history.h" 16 #include "chrome/browser/download/download_history.h"
17 #include "chrome/browser/download/download_prefs.h" 17 #include "chrome/browser/download/download_prefs.h"
18 #include "chrome/browser/download/download_service.h" 18 #include "chrome/browser/download/download_service.h"
19 #include "chrome/browser/download/download_service_factory.h" 19 #include "chrome/browser/download/download_service_factory.h"
20 #include "chrome/browser/net/url_request_mock_util.h" 20 #include "chrome/browser/net/url_request_mock_util.h"
21 #include "chrome/browser/prefs/pref_service.h" 21 #include "chrome/browser/prefs/pref_service.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 EXPECT_TRUE(false); 349 EXPECT_TRUE(false);
350 } 350 }
351 } 351 }
352 352
353 std::vector<DownloadPersistentStoreInfo> history_entries_; 353 std::vector<DownloadPersistentStoreInfo> history_entries_;
354 354
355 // Path to directory containing test data. 355 // Path to directory containing test data.
356 FilePath test_dir_; 356 FilePath test_dir_;
357 357
358 // Temporary directory we will save pages to. 358 // Temporary directory we will save pages to.
359 ScopedTempDir save_dir_; 359 base::ScopedTempDir save_dir_;
360 360
361 private: 361 private:
362 DISALLOW_COPY_AND_ASSIGN(SavePageBrowserTest); 362 DISALLOW_COPY_AND_ASSIGN(SavePageBrowserTest);
363 }; 363 };
364 364
365 SavePageBrowserTest::~SavePageBrowserTest() { 365 SavePageBrowserTest::~SavePageBrowserTest() {
366 } 366 }
367 367
368 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveHTMLOnly) { 368 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveHTMLOnly) {
369 GURL url = NavigateToMockURL("a"); 369 GURL url = NavigateToMockURL("a");
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 ASSERT_TRUE(WaitForSavePackageToFinish(browser(), &output_url)); 677 ASSERT_TRUE(WaitForSavePackageToFinish(browser(), &output_url));
678 EXPECT_EQ(url, output_url); 678 EXPECT_EQ(url, output_url);
679 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE); 679 CheckDownloadHistory(url, full_file_name, -1, DownloadItem::COMPLETE);
680 680
681 EXPECT_TRUE(file_util::PathExists(full_file_name)); 681 EXPECT_TRUE(file_util::PathExists(full_file_name));
682 int64 actual_file_size = -1; 682 int64 actual_file_size = -1;
683 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size)); 683 EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size));
684 EXPECT_LE(kFileSizeMin, actual_file_size); 684 EXPECT_LE(kFileSizeMin, actual_file_size);
685 } 685 }
686 686
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698