OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // The order of these includes is important. | 5 // The order of these includes is important. |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <unknwn.h> | 7 #include <unknwn.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <shlguid.h> | 9 #include <shlguid.h> |
10 #include <urlhist.h> | 10 #include <urlhist.h> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 history_count_ = 0; | 261 history_count_ = 0; |
262 password_count_ = 0; | 262 password_count_ = 0; |
263 favicon_count_ = 0; | 263 favicon_count_ = 0; |
264 } | 264 } |
265 | 265 |
266 // importer::ImporterProgressObserver: | 266 // importer::ImporterProgressObserver: |
267 virtual void ImportStarted() OVERRIDE {} | 267 virtual void ImportStarted() OVERRIDE {} |
268 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} | 268 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} |
269 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} | 269 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} |
270 virtual void ImportEnded() OVERRIDE { | 270 virtual void ImportEnded() OVERRIDE { |
271 MessageLoop::current()->Quit(); | 271 base::MessageLoop::current()->Quit(); |
272 EXPECT_EQ(arraysize(kIEBookmarks), bookmark_count_); | 272 EXPECT_EQ(arraysize(kIEBookmarks), bookmark_count_); |
273 EXPECT_EQ(1, history_count_); | 273 EXPECT_EQ(1, history_count_); |
274 EXPECT_EQ(arraysize(kIEFaviconGroup), favicon_count_); | 274 EXPECT_EQ(arraysize(kIEFaviconGroup), favicon_count_); |
275 } | 275 } |
276 | 276 |
277 virtual bool BookmarkModelIsLoaded() const { | 277 virtual bool BookmarkModelIsLoaded() const { |
278 // Profile is ready for writing. | 278 // Profile is ready for writing. |
279 return true; | 279 return true; |
280 } | 280 } |
281 | 281 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 public: | 367 public: |
368 MalformedFavoritesRegistryTestObserver() : ProfileWriter(NULL) { | 368 MalformedFavoritesRegistryTestObserver() : ProfileWriter(NULL) { |
369 bookmark_count_ = 0; | 369 bookmark_count_ = 0; |
370 } | 370 } |
371 | 371 |
372 // importer::ImporterProgressObserver: | 372 // importer::ImporterProgressObserver: |
373 virtual void ImportStarted() OVERRIDE {} | 373 virtual void ImportStarted() OVERRIDE {} |
374 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} | 374 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} |
375 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} | 375 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} |
376 virtual void ImportEnded() OVERRIDE { | 376 virtual void ImportEnded() OVERRIDE { |
377 MessageLoop::current()->Quit(); | 377 base::MessageLoop::current()->Quit(); |
378 EXPECT_EQ(arraysize(kIESortedBookmarks), bookmark_count_); | 378 EXPECT_EQ(arraysize(kIESortedBookmarks), bookmark_count_); |
379 } | 379 } |
380 | 380 |
381 virtual bool BookmarkModelIsLoaded() const { return true; } | 381 virtual bool BookmarkModelIsLoaded() const { return true; } |
382 virtual bool TemplateURLServiceIsLoaded() const { return true; } | 382 virtual bool TemplateURLServiceIsLoaded() const { return true; } |
383 | 383 |
384 virtual void AddPasswordForm(const content::PasswordForm& form) {} | 384 virtual void AddPasswordForm(const content::PasswordForm& form) {} |
385 virtual void AddHistoryPage(const history::URLRows& page, | 385 virtual void AddHistoryPage(const history::URLRows& page, |
386 history::VisitSource visit_source) {} | 386 history::VisitSource visit_source) {} |
387 virtual void AddKeyword(std::vector<TemplateURL*> template_url, | 387 virtual void AddKeyword(std::vector<TemplateURL*> template_url, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 importer::SourceProfile source_profile; | 492 importer::SourceProfile source_profile; |
493 source_profile.importer_type = importer::TYPE_IE; | 493 source_profile.importer_type = importer::TYPE_IE; |
494 source_profile.source_path = temp_dir_.path(); | 494 source_profile.source_path = temp_dir_.path(); |
495 | 495 |
496 host->StartImportSettings( | 496 host->StartImportSettings( |
497 source_profile, | 497 source_profile, |
498 browser()->profile(), | 498 browser()->profile(), |
499 importer::HISTORY | importer::PASSWORDS | importer::FAVORITES, | 499 importer::HISTORY | importer::PASSWORDS | importer::FAVORITES, |
500 observer); | 500 observer); |
501 MessageLoop::current()->Run(); | 501 base::MessageLoop::current()->Run(); |
502 | 502 |
503 // Cleans up. | 503 // Cleans up. |
504 url_history_stg2->DeleteUrl(kIEIdentifyUrl, 0); | 504 url_history_stg2->DeleteUrl(kIEIdentifyUrl, 0); |
505 url_history_stg2.Release(); | 505 url_history_stg2.Release(); |
506 } | 506 } |
507 | 507 |
508 IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, | 508 IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, |
509 IEImporterMalformedFavoritesRegistry) { | 509 IEImporterMalformedFavoritesRegistry) { |
510 // Sets up a favorites folder. | 510 // Sets up a favorites folder. |
511 base::FilePath path = temp_dir_.path().AppendASCII("Favorites"); | 511 base::FilePath path = temp_dir_.path().AppendASCII("Favorites"); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 568 |
569 importer::SourceProfile source_profile; | 569 importer::SourceProfile source_profile; |
570 source_profile.importer_type = importer::TYPE_IE; | 570 source_profile.importer_type = importer::TYPE_IE; |
571 source_profile.source_path = temp_dir_.path(); | 571 source_profile.source_path = temp_dir_.path(); |
572 | 572 |
573 host->StartImportSettings( | 573 host->StartImportSettings( |
574 source_profile, | 574 source_profile, |
575 browser()->profile(), | 575 browser()->profile(), |
576 importer::FAVORITES, | 576 importer::FAVORITES, |
577 observer); | 577 observer); |
578 MessageLoop::current()->Run(); | 578 base::MessageLoop::current()->Run(); |
579 } | 579 } |
580 } | 580 } |
OLD | NEW |