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

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

Issue 10963018: Rework arguments of HistoryService::AddPage() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile Created 8 years, 3 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 | Annotate | Revision Log
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/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/favicon/favicon_service_factory.h" 12 #include "chrome/browser/favicon/favicon_service_factory.h"
12 #include "chrome/browser/history/history.h" 13 #include "chrome/browser/history/history.h"
13 #include "chrome/browser/history/history_service_factory.h" 14 #include "chrome/browser/history/history_service_factory.h"
14 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
17 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
18 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
19 #include "chrome/test/base/test_browser_window.h" 20 #include "chrome/test/base/test_browser_window.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 GURL url2 = GURL("http://www.a.com/2"); 521 GURL url2 = GURL("http://www.a.com/2");
521 GURL url1_favicon("http://www.a.com/1/favicon.ico"); 522 GURL url1_favicon("http://www.a.com/1/favicon.ico");
522 523
523 NavigateAndCommit(url1); 524 NavigateAndCommit(url1);
524 // Navigate to a new URL so that url1 will be in the BackForwardMenuModel. 525 // Navigate to a new URL so that url1 will be in the BackForwardMenuModel.
525 NavigateAndCommit(url2); 526 NavigateAndCommit(url2);
526 527
527 // Set the desired favicon for url1. 528 // Set the desired favicon for url1.
528 HistoryServiceFactory::GetForProfile( 529 HistoryServiceFactory::GetForProfile(
529 profile(), Profile::EXPLICIT_ACCESS)->AddPage( 530 profile(), Profile::EXPLICIT_ACCESS)->AddPage(
530 url1, history::SOURCE_BROWSED); 531 url1, base::Time::Now(), history::SOURCE_BROWSED);
531 FaviconServiceFactory::GetForProfile( 532 FaviconServiceFactory::GetForProfile(
532 profile(), Profile::EXPLICIT_ACCESS)->SetFavicons( 533 profile(), Profile::EXPLICIT_ACCESS)->SetFavicons(
533 url1, url1_favicon, history::FAVICON, gfx::Image(new_icon_bitmap)); 534 url1, url1_favicon, history::FAVICON, gfx::Image(new_icon_bitmap));
534 535
535 // Will return the current icon (default) but start an anync call 536 // Will return the current icon (default) but start an anync call
536 // to retrieve the favicon from the favicon service. 537 // to retrieve the favicon from the favicon service.
537 gfx::Image default_icon; 538 gfx::Image default_icon;
538 back_model.GetIconAt(0, &default_icon); 539 back_model.GetIconAt(0, &default_icon);
539 540
540 // Make the favicon service run GetFavIconForURL, 541 // Make the favicon service run GetFavIconForURL,
(...skipping 21 matching lines...) Expand all
562 // Verify we did get the expected favicon. 563 // Verify we did get the expected favicon.
563 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), 564 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(),
564 valid_icon_bitmap.getPixels(), 565 valid_icon_bitmap.getPixels(),
565 new_icon_bitmap.getSize())); 566 new_icon_bitmap.getSize()));
566 567
567 // Make sure the browser deconstructor doesn't have problems. 568 // Make sure the browser deconstructor doesn't have problems.
568 chrome::CloseAllTabs(browser.get()); 569 chrome::CloseAllTabs(browser.get());
569 // This is required to prevent the message loop from hanging. 570 // This is required to prevent the message loop from hanging.
570 profile()->DestroyHistoryService(); 571 profile()->DestroyHistoryService();
571 } 572 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/typed_urls_helper.cc ('k') | chrome/browser/ui/views/external_tab_container_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698