OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <unknwn.h> | 8 #include <unknwn.h> |
9 #include <intshcut.h> | 9 #include <intshcut.h> |
10 #include <pstore.h> | 10 #include <pstore.h> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 ChromeThread file_thread_; | 115 ChromeThread file_thread_; |
116 FilePath test_path_; | 116 FilePath test_path_; |
117 FilePath profile_path_; | 117 FilePath profile_path_; |
118 FilePath app_path_; | 118 FilePath app_path_; |
119 }; | 119 }; |
120 | 120 |
121 const int kMaxPathSize = 5; | 121 const int kMaxPathSize = 5; |
122 | 122 |
123 typedef struct { | 123 typedef struct { |
124 const bool in_toolbar; | 124 const bool in_toolbar; |
125 const size_t path_size; | 125 const int path_size; |
126 const wchar_t* path[kMaxPathSize]; | 126 const wchar_t* path[kMaxPathSize]; |
127 const wchar_t* title; | 127 const wchar_t* title; |
128 const char* url; | 128 const char* url; |
129 } BookmarkList; | 129 } BookmarkList; |
130 | 130 |
131 typedef struct { | 131 typedef struct { |
132 const char* origin; | 132 const char* origin; |
133 const char* action; | 133 const char* action; |
134 const char* realm; | 134 const char* realm; |
135 const wchar_t* username_element; | 135 const wchar_t* username_element; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // Returns true if the |entry| is in the |list|. | 178 // Returns true if the |entry| is in the |list|. |
179 bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry, | 179 bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry, |
180 const BookmarkList* list, int list_size) { | 180 const BookmarkList* list, int list_size) { |
181 for (int i = 0; i < list_size; ++i) | 181 for (int i = 0; i < list_size; ++i) |
182 if (list[i].in_toolbar == entry.in_toolbar && | 182 if (list[i].in_toolbar == entry.in_toolbar && |
183 list[i].path_size == entry.path.size() && | 183 list[i].path_size == entry.path.size() && |
184 list[i].url == entry.url.spec() && | 184 list[i].url == entry.url.spec() && |
185 list[i].title == entry.title) { | 185 list[i].title == entry.title) { |
186 bool equal = true; | 186 bool equal = true; |
187 for (size_t k = 0; k < list[i].path_size; ++k) | 187 for (int k = 0; k < list[i].path_size; ++k) |
188 if (list[i].path[k] != entry.path[k]) { | 188 if (list[i].path[k] != entry.path[k]) { |
189 equal = false; | 189 equal = false; |
190 break; | 190 break; |
191 } | 191 } |
192 | 192 |
193 if (equal) | 193 if (equal) |
194 return true; | 194 return true; |
195 } | 195 } |
196 return false; | 196 return false; |
197 } | 197 } |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 true); | 863 true); |
864 } | 864 } |
865 | 865 |
866 TEST_F(ImporterTest, Firefox35Importer) { | 866 TEST_F(ImporterTest, Firefox35Importer) { |
867 bool import_search_engines = false; | 867 bool import_search_engines = false; |
868 scoped_refptr<Firefox3Observer> observer = | 868 scoped_refptr<Firefox3Observer> observer = |
869 new Firefox3Observer(import_search_engines); | 869 new Firefox3Observer(import_search_engines); |
870 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), | 870 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), |
871 import_search_engines); | 871 import_search_engines); |
872 } | 872 } |
OLD | NEW |