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

Side by Side Diff: chrome/utility/importer/bookmarks_file_importer_unittest.cc

Issue 23449036: importer: Allow user to import some missing URLS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/utility/importer/bookmarks_file_importer.cc ('k') | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/utility/importer/bookmarks_file_importer.h" 5 #include "chrome/utility/importer/bookmarks_file_importer.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace internal { 10 namespace internal {
11 11
12 bool CanImportURL(const GURL& url); 12 bool CanImportURL(const GURL& url);
13 13
14 } // namespace internal 14 } // namespace internal
15 15
16 TEST(BookmarksFileImporterTest, CanImportURL) { 16 TEST(BookmarksFileImporterTest, CanImportURL) {
17 struct TestCase { 17 struct TestCase {
18 const std::string url; 18 const std::string url;
19 const bool can_be_imported; 19 const bool can_be_imported;
20 } test_cases[] = { 20 } test_cases[] = {
21 { "http://www.example.com", true }, 21 { "http://www.example.com", true },
22 { "https://www.example.com", true }, 22 { "https://www.example.com", true },
23 { "ftp://www.example.com", true }, 23 { "ftp://www.example.com", true },
24 { "aim:GoIm?screenname=myscreenname&message=hello", true }, 24 { "aim:GoIm?screenname=myscreenname&message=hello", true },
25 { "chrome://version", true }, 25 { "chrome://version", true },
26 { "chrome://chrome-urls", true }, 26 { "chrome://chrome-urls", true },
27 { "chrome://kill", true }, 27 { "chrome://kill", true },
28 { "chrome://chrome", true },
29 { "chrome://about", true },
28 { "about:version", true }, 30 { "about:version", true },
29 { "about:blank", true }, 31 { "about:blank", true },
30 { "about:credits", true }, 32 { "about:credits", true },
31 { "wyciwyg://example.com", false }, 33 { "wyciwyg://example.com", false },
32 { "place://google.com", false }, 34 { "place://google.com", false },
33 { "about:config", false }, 35 { "about:config", false },
34 { "about:moon", false }, 36 { "about:moon", false },
35 }; 37 };
36 38
37 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 39 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
38 EXPECT_EQ(test_cases[i].can_be_imported, 40 EXPECT_EQ(test_cases[i].can_be_imported,
39 internal::CanImportURL(GURL(test_cases[i].url))); 41 internal::CanImportURL(GURL(test_cases[i].url)));
40 } 42 }
41 } 43 }
OLDNEW
« no previous file with comments | « chrome/utility/importer/bookmarks_file_importer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698