| 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" |
| 11 #include "chrome/browser/extensions/test_extension_system.h" | 11 #include "chrome/browser/extensions/test_extension_system.h" |
| 12 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" | 12 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/test/base/browser_with_test_window_test.h" | 17 #include "chrome/test/base/browser_with_test_window_test.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 19 #include "ui/events/event_constants.h" | 19 #include "ui/events/event_constants.h" |
| 20 #include "ui/gfx/range/range.h" | 20 #include "ui/gfx/range/range.h" |
| 21 | 21 |
| 22 class BookmarkBubbleSignInDelegateTest : public BrowserWithTestWindowTest { | 22 class BookmarkBubbleSignInDelegateTest : public BrowserWithTestWindowTest { |
| 23 public: | 23 public: |
| 24 BookmarkBubbleSignInDelegateTest() {} | 24 BookmarkBubbleSignInDelegateTest() {} |
| 25 | 25 |
| 26 virtual void SetUp() override; | 26 void SetUp() override; |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 class Window : public TestBrowserWindow { | 29 class Window : public TestBrowserWindow { |
| 30 public: | 30 public: |
| 31 Window() : show_count_(0) {} | 31 Window() : show_count_(0) {} |
| 32 | 32 |
| 33 int show_count() { return show_count_; } | 33 int show_count() { return show_count_; } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // TestBrowserWindow: | 36 // TestBrowserWindow: |
| (...skipping 103 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 |