| OLD | NEW |
| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 13 #include "chrome/browser/chrome_content_browser_client.h" | 13 #include "chrome/browser/chrome_content_browser_client.h" |
| 14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
| 15 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 17 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_tabstrip.h" | 19 #include "chrome/browser/ui/browser_tabstrip.h" |
| 19 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 21 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 22 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 22 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 23 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
| 23 #include "chrome/common/chrome_content_client.h" | 24 #include "chrome/common/chrome_content_client.h" |
| 24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // the names f1-f100. | 247 // the names f1-f100. |
| 247 // | 248 // |
| 248 // Subclasses should be sure and invoke super's implementation of SetUp and | 249 // Subclasses should be sure and invoke super's implementation of SetUp and |
| 249 // TearDown. | 250 // TearDown. |
| 250 class BookmarkBarViewEventTestBase : public ViewEventTestBase { | 251 class BookmarkBarViewEventTestBase : public ViewEventTestBase { |
| 251 public: | 252 public: |
| 252 BookmarkBarViewEventTestBase() | 253 BookmarkBarViewEventTestBase() |
| 253 : ViewEventTestBase(), | 254 : ViewEventTestBase(), |
| 254 model_(NULL) {} | 255 model_(NULL) {} |
| 255 | 256 |
| 257 static void SetUpTestCase() { |
| 258 ViewEventTestBase::SetUpTestCase(); |
| 259 // Creating a browser requires platform parental controls initialization. |
| 260 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 261 } |
| 262 |
| 263 static void TearDownTestCase() { |
| 264 IncognitoModePrefs::UninitializePlatformParentalControls(); |
| 265 ViewEventTestBase::TearDownTestCase(); |
| 266 } |
| 267 |
| 256 void SetUp() override { | 268 void SetUp() override { |
| 257 content_client_.reset(new ChromeContentClient); | 269 content_client_.reset(new ChromeContentClient); |
| 258 content::SetContentClient(content_client_.get()); | 270 content::SetContentClient(content_client_.get()); |
| 259 browser_content_client_.reset(new chrome::ChromeContentBrowserClient()); | 271 browser_content_client_.reset(new chrome::ChromeContentBrowserClient()); |
| 260 content::SetBrowserClientForTesting(browser_content_client_.get()); | 272 content::SetBrowserClientForTesting(browser_content_client_.get()); |
| 261 | 273 |
| 262 views::MenuController::TurnOffMenuSelectionHoldForTest(); | 274 views::MenuController::TurnOffMenuSelectionHoldForTest(); |
| 263 BookmarkBarView::DisableAnimationsForTesting(true); | 275 BookmarkBarView::DisableAnimationsForTesting(true); |
| 264 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); | 276 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); |
| 265 | 277 |
| (...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 }; | 2065 }; |
| 2054 | 2066 |
| 2055 #if defined(OS_WIN) | 2067 #if defined(OS_WIN) |
| 2056 // This test times out on Windows. TODO(pkotwicz): Find out why. | 2068 // This test times out on Windows. TODO(pkotwicz): Find out why. |
| 2057 #define MAYBE_CloseSourceBrowserDuringDrag DISABLED_CloseSourceBrowserDuringDrag | 2069 #define MAYBE_CloseSourceBrowserDuringDrag DISABLED_CloseSourceBrowserDuringDrag |
| 2058 #else | 2070 #else |
| 2059 #define MAYBE_CloseSourceBrowserDuringDrag CloseSourceBrowserDuringDrag | 2071 #define MAYBE_CloseSourceBrowserDuringDrag CloseSourceBrowserDuringDrag |
| 2060 #endif | 2072 #endif |
| 2061 | 2073 |
| 2062 VIEW_TEST(BookmarkBarViewTest22, MAYBE_CloseSourceBrowserDuringDrag) | 2074 VIEW_TEST(BookmarkBarViewTest22, MAYBE_CloseSourceBrowserDuringDrag) |
| OLD | NEW |