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

Side by Side Diff: chrome/browser/app_controller_mac_browsertest.mm

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 #import <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #import <Foundation/NSAppleEventDescriptor.h> 8 #import <Foundation/NSAppleEventDescriptor.h>
9 #import <objc/message.h> 9 #import <objc/message.h>
10 #import <objc/runtime.h> 10 #import <objc/runtime.h>
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // Constants for bookmarks that we will create later. 511 // Constants for bookmarks that we will create later.
512 const base::string16 title1(base::ASCIIToUTF16("Dinosaur Comics")); 512 const base::string16 title1(base::ASCIIToUTF16("Dinosaur Comics"));
513 const GURL url1("http://qwantz.com//"); 513 const GURL url1("http://qwantz.com//");
514 514
515 const base::string16 title2(base::ASCIIToUTF16("XKCD")); 515 const base::string16 title2(base::ASCIIToUTF16("XKCD"));
516 const GURL url2("https://www.xkcd.com/"); 516 const GURL url2("https://www.xkcd.com/");
517 517
518 // Use the existing profile as profile 1. 518 // Use the existing profile as profile 1.
519 Profile* profile1 = browser()->profile(); 519 Profile* profile1 = browser()->profile();
520 bookmarks::test::WaitForBookmarkModelToLoad( 520 bookmarks::test::WaitForBookmarkModelToLoad(
521 BookmarkModelFactory::GetForProfile(profile1)); 521 BookmarkModelFactory::GetForBrowserContext(profile1));
522 522
523 // Create profile 2. 523 // Create profile 2.
524 base::FilePath path2 = profile_manager->GenerateNextProfileDirectoryPath(); 524 base::FilePath path2 = profile_manager->GenerateNextProfileDirectoryPath();
525 Profile* profile2 = 525 Profile* profile2 =
526 Profile::CreateProfile(path2, NULL, Profile::CREATE_MODE_SYNCHRONOUS); 526 Profile::CreateProfile(path2, NULL, Profile::CREATE_MODE_SYNCHRONOUS);
527 profile_manager->RegisterTestingProfile(profile2, false, true); 527 profile_manager->RegisterTestingProfile(profile2, false, true);
528 bookmarks::test::WaitForBookmarkModelToLoad( 528 bookmarks::test::WaitForBookmarkModelToLoad(
529 BookmarkModelFactory::GetForProfile(profile2)); 529 BookmarkModelFactory::GetForBrowserContext(profile2));
530 530
531 // Switch to profile 1, create bookmark 1 and force the menu to build. 531 // Switch to profile 1, create bookmark 1 and force the menu to build.
532 [ac windowChangedToProfile:profile1]; 532 [ac windowChangedToProfile:profile1];
533 [ac bookmarkMenuBridge]->GetBookmarkModel()->AddURL( 533 [ac bookmarkMenuBridge]->GetBookmarkModel()->AddURL(
534 [ac bookmarkMenuBridge]->GetBookmarkModel()->bookmark_bar_node(), 534 [ac bookmarkMenuBridge]->GetBookmarkModel()->bookmark_bar_node(),
535 0, title1, url1); 535 0, title1, url1);
536 [ac bookmarkMenuBridge]->BuildMenu(); 536 [ac bookmarkMenuBridge]->BuildMenu();
537 537
538 // Switch to profile 2, create bookmark 2 and force the menu to build. 538 // Switch to profile 2, create bookmark 2 and force the menu to build.
539 [ac windowChangedToProfile:profile2]; 539 [ac windowChangedToProfile:profile2];
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 ui_test_utils::NavigateToURL(browser3, test_url1); 689 ui_test_utils::NavigateToURL(browser3, test_url1);
690 EXPECT_EQ(g_handoff_url, GURL()); 690 EXPECT_EQ(g_handoff_url, GURL());
691 691
692 // Activate the original browser window. 692 // Activate the original browser window.
693 Browser* browser1 = active_browser_list->get(0); 693 Browser* browser1 = active_browser_list->get(0);
694 browser1->window()->Show(); 694 browser1->window()->Show();
695 EXPECT_EQ(g_handoff_url, test_url2); 695 EXPECT_EQ(g_handoff_url, test_url2);
696 } 696 }
697 697
698 } // namespace 698 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698