Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/toolbar/back_forward_menu_model.h" 5 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 512
513 GURL url1 = GURL("http://www.a.com/1"); 513 GURL url1 = GURL("http://www.a.com/1");
514 GURL url2 = GURL("http://www.a.com/2"); 514 GURL url2 = GURL("http://www.a.com/2");
515 GURL url1_favicon("http://www.a.com/1/favicon.ico"); 515 GURL url1_favicon("http://www.a.com/1/favicon.ico");
516 516
517 NavigateAndCommit(url1); 517 NavigateAndCommit(url1);
518 // Navigate to a new URL so that url1 will be in the BackForwardMenuModel. 518 // Navigate to a new URL so that url1 will be in the BackForwardMenuModel.
519 NavigateAndCommit(url2); 519 NavigateAndCommit(url2);
520 520
521 // Set the desired favicon for url1. 521 // Set the desired favicon for url1.
522 HistoryServiceFactory::GetForProfile( 522 HistoryServiceFactory::GetForProfile(profile(),
523 profile(), Profile::EXPLICIT_ACCESS)->AddPage( 523 ServiceAccessType::EXPLICIT_ACCESS)
524 url1, base::Time::Now(), history::SOURCE_BROWSED); 524 ->AddPage(url1, base::Time::Now(), history::SOURCE_BROWSED);
525 FaviconServiceFactory::GetForProfile(profile(), Profile::EXPLICIT_ACCESS) 525 FaviconServiceFactory::GetForProfile(profile(),
526 ->SetFavicons(url1, 526 ServiceAccessType::EXPLICIT_ACCESS)
527 url1_favicon, 527 ->SetFavicons(url1, url1_favicon, favicon_base::FAVICON,
528 favicon_base::FAVICON,
529 gfx::Image::CreateFrom1xBitmap(new_icon_bitmap)); 528 gfx::Image::CreateFrom1xBitmap(new_icon_bitmap));
530 529
531 // Will return the current icon (default) but start an anync call 530 // Will return the current icon (default) but start an anync call
532 // to retrieve the favicon from the favicon service. 531 // to retrieve the favicon from the favicon service.
533 gfx::Image default_icon; 532 gfx::Image default_icon;
534 back_model.GetIconAt(0, &default_icon); 533 back_model.GetIconAt(0, &default_icon);
535 534
536 // Make the favicon service run GetFavIconForURL, 535 // Make the favicon service run GetFavIconForURL,
537 // FaviconDelegate.OnIconChanged will be called. 536 // FaviconDelegate.OnIconChanged will be called.
538 base::MessageLoop::current()->Run(); 537 base::MessageLoop::current()->Run();
(...skipping 19 matching lines...) Expand all
558 // Verify we did get the expected favicon. 557 // Verify we did get the expected favicon.
559 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), 558 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(),
560 valid_icon_bitmap.getPixels(), 559 valid_icon_bitmap.getPixels(),
561 new_icon_bitmap.getSize())); 560 new_icon_bitmap.getSize()));
562 561
563 // Make sure the browser deconstructor doesn't have problems. 562 // Make sure the browser deconstructor doesn't have problems.
564 browser->tab_strip_model()->CloseAllTabs(); 563 browser->tab_strip_model()->CloseAllTabs();
565 // This is required to prevent the message loop from hanging. 564 // This is required to prevent the message loop from hanging.
566 profile()->DestroyHistoryService(); 565 profile()->DestroyHistoryService();
567 } 566 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/back_forward_menu_model.cc ('k') | chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698