Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / utility / importer / bookmarks_file_importer_unittest.cc
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     { "chrome://chrome", true },
29     { "chrome://about", true },
30     { "about:version", true },
31     { "about:blank", true },
32     { "about:credits", true },
33     { "wyciwyg://example.com", false },
34     { "place://google.com", false },
35     { "about:config", false },
36     { "about:moon", false },
37   };
38
39   for (size_t i = 0; i < arraysize(test_cases); ++i) {
40     EXPECT_EQ(test_cases[i].can_be_imported,
41               internal::CanImportURL(GURL(test_cases[i].url)));
42   }
43 }