Chromium Code Reviews| Index: chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller_unittest.mm |
| diff --git a/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller_unittest.mm |
| index d48823787d947b18f4e949c7e1de20ca9f6afb21..5f5b75cda568163be5ced6f4274b1dd08ee8efb7 100644 |
| --- a/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller_unittest.mm |
| +++ b/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller_unittest.mm |
| @@ -4,6 +4,7 @@ |
| #import "chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.h" |
| +#include "base/command_line.h" |
| #include "base/mac/scoped_nsobject.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/message_loop/message_pump_mac.h" |
| @@ -15,6 +16,7 @@ |
| #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| #include "chrome/test/base/testing_browser_process.h" |
| #include "chrome/test/base/testing_profile_manager.h" |
| +#include "components/signin/core/common/profile_management_switches.h" |
| #include "testing/gtest_mac.h" |
| #import "ui/base/cocoa/controls/hyperlink_button_cell.h" |
| #include "ui/events/test/cocoa_test_event_utils.h" |
| @@ -26,19 +28,25 @@ class AvatarMenuBubbleControllerTest : public CocoaTest { |
| } |
| void SetUp() override { |
| + switches::DisableNewAvatarMenuForTesting( |
| + base::CommandLine::ForCurrentProcess()); |
| + |
| CocoaTest::SetUp(); |
| ASSERT_TRUE(manager_.SetUp()); |
| - manager_.CreateTestingProfile("test1", scoped_ptr<PrefServiceSyncable>(), |
| - base::ASCIIToUTF16("Test 1"), 1, |
| - std::string(), |
| - TestingProfile::TestingFactories()); |
| - manager_.CreateTestingProfile("test2", scoped_ptr<PrefServiceSyncable>(), |
| - base::ASCIIToUTF16("Test 2"), 0, |
| - std::string(), |
| - TestingProfile::TestingFactories()); |
| - |
| - menu_ = new AvatarMenu(manager_.profile_info_cache(), NULL, NULL); |
| + testing_profile_manager()->CreateTestingProfile( |
|
Scott Hess - ex-Googler
2015/03/07 04:33:07
Why are you going to the point of making this chan
Mike Lerman
2015/03/09 14:28:34
You're right. I had made this change as part of an
Scott Hess - ex-Googler
2015/03/09 15:36:27
OK - that's kind of what I figured, but wondered i
|
| + "test1", scoped_ptr<PrefServiceSyncable>(), |
| + base::ASCIIToUTF16("Test 1"), 1, |
| + std::string(), |
| + TestingProfile::TestingFactories()); |
| + testing_profile_manager()->CreateTestingProfile( |
| + "test2", scoped_ptr<PrefServiceSyncable>(), |
| + base::ASCIIToUTF16("Test 2"), 0, |
| + std::string(), |
| + TestingProfile::TestingFactories()); |
| + |
| + menu_ = new AvatarMenu(testing_profile_manager()->profile_info_cache(), |
| + NULL, NULL); |
| menu_->RebuildMenu(); |
| NSRect frame = [test_window() frame]; |
| @@ -49,7 +57,7 @@ class AvatarMenuBubbleControllerTest : public CocoaTest { |
| anchoredAt:point]; |
| } |
| - TestingProfileManager* manager() { return &manager_; } |
| + TestingProfileManager* testing_profile_manager() { return &manager_; } |
| AvatarMenuBubbleController* controller() { return controller_; } |
| AvatarMenu* menu() { return menu_; } |
| @@ -78,7 +86,7 @@ TEST_F(AvatarMenuBubbleControllerTest, InitialLayout) { |
| NSView* contents = [[controller() window] contentView]; |
| EXPECT_EQ(4U, [[contents subviews] count]); |
| - // Loop over the itmes and match the viewController views to subviews. |
| + // Loop over the items and match the viewController views to subviews. |
| NSMutableArray* subviews = |
| [NSMutableArray arrayWithArray:[contents subviews]]; |
| for (AvatarMenuItemController* viewController in [controller() items]) { |
| @@ -125,10 +133,11 @@ TEST_F(AvatarMenuBubbleControllerTest, PerformLayout) { |
| base::scoped_nsobject<NSMutableArray> oldItems([[controller() items] copy]); |
| // Now create a new profile and notify the delegate. |
| - manager()->CreateTestingProfile("test3", scoped_ptr<PrefServiceSyncable>(), |
| - base::ASCIIToUTF16("Test 3"), 0, |
| - std::string(), |
| - TestingProfile::TestingFactories()); |
| + testing_profile_manager()->CreateTestingProfile( |
| + "test3", scoped_ptr<PrefServiceSyncable>(), |
| + base::ASCIIToUTF16("Test 3"), 0, |
| + std::string(), |
| + TestingProfile::TestingFactories()); |
| // Testing the bridge is not worth the effort... |
| [controller() performLayout]; |