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

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

Issue 684613002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 private: 266 private:
267 content::DownloadManager* download_manager_; 267 content::DownloadManager* download_manager_;
268 base::Closure callback_; 268 base::Closure callback_;
269 269
270 DISALLOW_COPY_AND_ASSIGN(SavePackageFinishedObserver); 270 DISALLOW_COPY_AND_ASSIGN(SavePackageFinishedObserver);
271 }; 271 };
272 272
273 class SavePageBrowserTest : public InProcessBrowserTest { 273 class SavePageBrowserTest : public InProcessBrowserTest {
274 public: 274 public:
275 SavePageBrowserTest() {} 275 SavePageBrowserTest() {}
276 virtual ~SavePageBrowserTest(); 276 ~SavePageBrowserTest() override;
277 277
278 protected: 278 protected:
279 virtual void SetUp() override { 279 void SetUp() override {
280 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir_)); 280 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir_));
281 ASSERT_TRUE(save_dir_.CreateUniqueTempDir()); 281 ASSERT_TRUE(save_dir_.CreateUniqueTempDir());
282 InProcessBrowserTest::SetUp(); 282 InProcessBrowserTest::SetUp();
283 } 283 }
284 284
285 void SetUpOnMainThread() override { 285 void SetUpOnMainThread() override {
286 browser()->profile()->GetPrefs()->SetFilePath( 286 browser()->profile()->GetPrefs()->SetFilePath(
287 prefs::kDownloadDefaultDirectory, save_dir_.path()); 287 prefs::kDownloadDefaultDirectory, save_dir_.path());
288 browser()->profile()->GetPrefs()->SetFilePath( 288 browser()->profile()->GetPrefs()->SetFilePath(
289 prefs::kSaveFileDefaultDirectory, save_dir_.path()); 289 prefs::kSaveFileDefaultDirectory, save_dir_.path());
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 EXPECT_TRUE(base::PathExists(full_file_name)); 741 EXPECT_TRUE(base::PathExists(full_file_name));
742 742
743 EXPECT_TRUE(base::DieFileDie(full_file_name, false)); 743 EXPECT_TRUE(base::DieFileDie(full_file_name, false));
744 EXPECT_TRUE(base::DieFileDie(dir, true)); 744 EXPECT_TRUE(base::DieFileDie(dir, true));
745 } 745 }
746 #endif 746 #endif
747 747
748 class SavePageAsMHTMLBrowserTest : public SavePageBrowserTest { 748 class SavePageAsMHTMLBrowserTest : public SavePageBrowserTest {
749 public: 749 public:
750 SavePageAsMHTMLBrowserTest() {} 750 SavePageAsMHTMLBrowserTest() {}
751 virtual ~SavePageAsMHTMLBrowserTest(); 751 ~SavePageAsMHTMLBrowserTest() override;
752 void SetUpCommandLine(CommandLine* command_line) override { 752 void SetUpCommandLine(CommandLine* command_line) override {
753 command_line->AppendSwitch(switches::kSavePageAsMHTML); 753 command_line->AppendSwitch(switches::kSavePageAsMHTML);
754 } 754 }
755 755
756 private: 756 private:
757 DISALLOW_COPY_AND_ASSIGN(SavePageAsMHTMLBrowserTest); 757 DISALLOW_COPY_AND_ASSIGN(SavePageAsMHTMLBrowserTest);
758 }; 758 };
759 759
760 SavePageAsMHTMLBrowserTest::~SavePageAsMHTMLBrowserTest() { 760 SavePageAsMHTMLBrowserTest::~SavePageAsMHTMLBrowserTest() {
761 } 761 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( 801 base::FilePath download_dir = DownloadPrefs::FromDownloadManager(
802 GetDownloadManager())->DownloadPath(); 802 GetDownloadManager())->DownloadPath();
803 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); 803 base::FilePath filename = download_dir.AppendASCII("dataurl.txt");
804 ASSERT_TRUE(base::PathExists(filename)); 804 ASSERT_TRUE(base::PathExists(filename));
805 std::string contents; 805 std::string contents;
806 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); 806 EXPECT_TRUE(base::ReadFileToString(filename, &contents));
807 EXPECT_EQ("foo", contents); 807 EXPECT_EQ("foo", contents);
808 } 808 }
809 809
810 } // namespace 810 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698