Chromium Code Reviews| Index: chrome/browser/importer/ie_importer_browsertest_win.cc |
| diff --git a/chrome/browser/importer/ie_importer_browsertest_win.cc b/chrome/browser/importer/ie_importer_browsertest_win.cc |
| index d41961481d398b59e5dc852c5ac4203c92dab4db..57df0f3479b7a63f7365a250aa4ec3c905503ffb 100644 |
| --- a/chrome/browser/importer/ie_importer_browsertest_win.cc |
| +++ b/chrome/browser/importer/ie_importer_browsertest_win.cc |
| @@ -85,6 +85,10 @@ const base::char16 kIEIdentifyUrl[] = |
| L"http://A79029D6-753E-4e27-B807-3D46AB1545DF.com:8080/path?key=value"; |
| const base::char16 kIEIdentifyTitle[] = |
| L"Unittest GUID"; |
| +const base::char16 kIECacheItemUrl[] = |
| + L"http://B2EF40C8-2569-4D7E-97EA-BAD9DF468D9C.com"; |
| +const base::char16 kIECacheItemTitle[] = |
| + L"Unittest Cache Item GUID"; |
| const base::char16 kFaviconStreamSuffix[] = L"url:favicon:$DATA"; |
| const char kDummyFaviconImageData[] = |
| @@ -241,7 +245,7 @@ class TestObserver : public ProfileWriter, |
| EXPECT_EQ(arraysize(kIEFaviconGroup), favicon_count_); |
| } |
| if (importer_items_ & importer::HISTORY) |
| - EXPECT_EQ(1, history_count_); |
| + EXPECT_EQ(2, history_count_); |
| if (importer_items_ & importer::HOME_PAGE) |
| EXPECT_EQ(1, homepage_count_); |
| if ((importer_items_ & importer::PASSWORDS) && (ie_version_ == IE7)) |
| @@ -274,12 +278,25 @@ class TestObserver : public ProfileWriter, |
| virtual void AddHistoryPage(const history::URLRows& page, |
| history::VisitSource visit_source) { |
| + bool cache_item_found_ = false; |
| + bool history_item_found_ = false; |
| // Importer should read the specified URL. |
| for (size_t i = 0; i < page.size(); ++i) { |
| if (page[i].title() == kIEIdentifyTitle && |
| - page[i].url() == GURL(kIEIdentifyUrl)) |
| + page[i].url() == GURL(kIEIdentifyUrl)) { |
| + EXPECT_FALSE(page[i].hidden()); |
| + history_item_found_ = true; |
| ++history_count_; |
| + } |
| + if (page[i].title() == kIECacheItemTitle && |
| + page[i].url() == GURL(kIECacheItemUrl)) { |
| + EXPECT_TRUE(page[i].hidden()); |
| + cache_item_found_ = true; |
| + ++history_count_; |
| + } |
| } |
| + EXPECT_TRUE(history_item_found_); |
| + EXPECT_TRUE(cache_item_found_); |
| EXPECT_EQ(history::SOURCE_IE_IMPORTED, visit_source); |
| } |
| @@ -480,8 +497,12 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) { |
| res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, |
| CLSCTX_INPROC_SERVER); |
| ASSERT_TRUE(res == S_OK); |
| - res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); |
| + res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, |
| + ADDURL_ADDTOHISTORYANDCACHE); |
|
gab
2014/12/11 16:29:49
Any documentation for ADDURL_ADDTOHISTORYANDCACHE?
Alexey Seren
2014/12/12 10:07:08
Here is documentation:
http://msdn.microsoft.com/r
gab
2014/12/12 14:58:31
Thanks, can you add a comment above pointing at th
Alexey Seren
2014/12/15 14:00:23
Acknowledged.
|
| ASSERT_TRUE(res == S_OK); |
| + res = url_history_stg2->AddUrl(kIECacheItemUrl, kIECacheItemTitle, |
| + ADDURL_ADDTOCACHE); |
| + EXPECT_TRUE(res == S_OK); |
| // Starts to import the above settings. |
| // Deletes itself. |
| @@ -503,6 +524,7 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) { |
| base::MessageLoop::current()->Run(); |
| // Cleans up. |
| + url_history_stg2->DeleteUrl(kIECacheItemUrl, 0); |
| url_history_stg2->DeleteUrl(kIEIdentifyUrl, 0); |
|
gab
2014/12/11 16:29:49
nit: flip these two since kIECacheItemUrl always c
Alexey Seren
2014/12/12 10:07:08
Acknowledged.
|
| url_history_stg2.Release(); |
| } |