Home | History | Annotate | Download | only in importer
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/utility/importer/bookmarks_file_importer.h"
      6 
      7 #include "testing/gtest/include/gtest/gtest.h"
      8 #include "url/gurl.h"
      9 
     10 namespace internal {
     11 
     12 bool CanImportURL(const GURL& url);
     13 
     14 }  // namespace internal
     15 
     16 TEST(BookmarksFileImporterTest, CanImportURL) {
     17   struct TestCase {
     18     const std::string url;
     19     const bool can_be_imported;
     20   } test_cases[] = {
     21     { "http://www.example.com", true },
     22     { "https://www.example.com", true },
     23     { "ftp://www.example.com", true },
     24     { "aim:GoIm?screenname=myscreenname&message=hello", true },
     25     { "chrome://version", true },
     26     { "chrome://chrome-urls", true },
     27     { "chrome://kill", true },
     28     { "about:version", true },
     29     { "about:blank", true },
     30     { "about:credits", true },
     31     { "wyciwyg://example.com", false },
     32     { "place://google.com", false },
     33     { "about:config", false },
     34     { "about:moon", false },
     35   };
     36 
     37   for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
     38     EXPECT_EQ(test_cases[i].can_be_imported,
     39               internal::CanImportURL(GURL(test_cases[i].url)));
     40   }
     41 }
     42