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

Side by Side Diff: chrome/browser/importer/safari_importer_unittest.mm

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « chrome/browser/importer/safari_importer.mm ('k') | chrome/browser/jumplist_win.cc » ('j') | 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 "chrome/browser/importer/safari_importer.h" 5 #include "chrome/browser/importer/safari_importer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // Our simulated ~/Library directory 31 // Our simulated ~/Library directory
32 test_dir = test_dir.AppendASCII("safari_import"); 32 test_dir = test_dir.AppendASCII("safari_import");
33 return test_dir; 33 return test_dir;
34 } 34 }
35 35
36 class SafariImporterTest : public PlatformTest { 36 class SafariImporterTest : public PlatformTest {
37 public: 37 public:
38 SafariImporter* GetSafariImporter() { 38 SafariImporter* GetSafariImporter() {
39 base::FilePath test_library_dir = GetTestSafariLibraryPath(); 39 base::FilePath test_library_dir = GetTestSafariLibraryPath();
40 CHECK(file_util::PathExists(test_library_dir)) << 40 CHECK(base::PathExists(test_library_dir)) <<
41 "Missing test data directory"; 41 "Missing test data directory";
42 42
43 return new SafariImporter(test_library_dir); 43 return new SafariImporter(test_library_dir);
44 } 44 }
45 }; 45 };
46 46
47 TEST_F(SafariImporterTest, HistoryImport) { 47 TEST_F(SafariImporterTest, HistoryImport) {
48 scoped_refptr<SafariImporter> importer(GetSafariImporter()); 48 scoped_refptr<SafariImporter> importer(GetSafariImporter());
49 49
50 std::vector<ImporterURLRow> history_items; 50 std::vector<ImporterURLRow> history_items;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 EXPECT_EQ(items & importer::COOKIES, importer::NONE); 191 EXPECT_EQ(items & importer::COOKIES, importer::NONE);
192 EXPECT_EQ(items & importer::PASSWORDS, importer::NONE); 192 EXPECT_EQ(items & importer::PASSWORDS, importer::NONE);
193 EXPECT_EQ(items & importer::SEARCH_ENGINES, importer::NONE); 193 EXPECT_EQ(items & importer::SEARCH_ENGINES, importer::NONE);
194 EXPECT_EQ(items & importer::HOME_PAGE, importer::NONE); 194 EXPECT_EQ(items & importer::HOME_PAGE, importer::NONE);
195 195
196 // Check that we don't import anything from a bogus library directory. 196 // Check that we don't import anything from a bogus library directory.
197 base::ScopedTempDir fake_library_dir; 197 base::ScopedTempDir fake_library_dir;
198 ASSERT_TRUE(fake_library_dir.CreateUniqueTempDir()); 198 ASSERT_TRUE(fake_library_dir.CreateUniqueTempDir());
199 EXPECT_FALSE(SafariImporter::CanImport(fake_library_dir.path(), &items)); 199 EXPECT_FALSE(SafariImporter::CanImport(fake_library_dir.path(), &items));
200 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/safari_importer.mm ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698