OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/extensions/test_extension_service.h" | 10 #include "chrome/browser/extensions/test_extension_service.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 }; | 43 }; |
44 | 44 |
45 BrowserWindow* CreateBrowserWindow() override { return new Window(); } | 45 BrowserWindow* CreateBrowserWindow() override { return new Window(); } |
46 | 46 |
47 private: | 47 private: |
48 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleSignInDelegateTest); | 48 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleSignInDelegateTest); |
49 }; | 49 }; |
50 | 50 |
51 void BookmarkBubbleSignInDelegateTest::SetUp() { | 51 void BookmarkBubbleSignInDelegateTest::SetUp() { |
52 BrowserWithTestWindowTest::SetUp(); | 52 BrowserWithTestWindowTest::SetUp(); |
53 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 53 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
54 // Force web-based signin, otherwise tests will crash because inline signin | 54 // Force web-based signin, otherwise tests will crash because inline signin |
55 // involves IO thread operation. | 55 // involves IO thread operation. |
56 // TODO(guohui): fix the test for inline signin. | 56 // TODO(guohui): fix the test for inline signin. |
57 command_line->AppendSwitch(switches::kEnableWebBasedSignin); | 57 command_line->AppendSwitch(switches::kEnableWebBasedSignin); |
58 // Adds TestExtensionSystem, since signin uses the gaia auth extension. | 58 // Adds TestExtensionSystem, since signin uses the gaia auth extension. |
59 static_cast<extensions::TestExtensionSystem*>( | 59 static_cast<extensions::TestExtensionSystem*>( |
60 extensions::ExtensionSystem::Get(profile()))->CreateExtensionService( | 60 extensions::ExtensionSystem::Get(profile()))->CreateExtensionService( |
61 command_line, base::FilePath(), false); | 61 command_line, base::FilePath(), false); |
62 } | 62 } |
63 | 63 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // visible. | 140 // visible. |
141 int tab_count = extra_browser->tab_strip_model()->count(); | 141 int tab_count = extra_browser->tab_strip_model()->count(); |
142 EXPECT_EQ(starting_tab_count + 1, tab_count); | 142 EXPECT_EQ(starting_tab_count + 1, tab_count); |
143 EXPECT_LE(1, | 143 EXPECT_LE(1, |
144 static_cast<BookmarkBubbleSignInDelegateTest::Window*>( | 144 static_cast<BookmarkBubbleSignInDelegateTest::Window*>( |
145 extra_window.get())->show_count()); | 145 extra_window.get())->show_count()); |
146 | 146 |
147 // Required to avoid a crash when the browser is deleted. | 147 // Required to avoid a crash when the browser is deleted. |
148 extra_browser->tab_strip_model()->CloseAllTabs(); | 148 extra_browser->tab_strip_model()->CloseAllTabs(); |
149 } | 149 } |
OLD | NEW |