| 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 "chrome/browser/ui/views/location_bar/star_view.h" | 5 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 11 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 13 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/test/base/interactive_test_utils.h" | 15 #include "chrome/test/base/interactive_test_utils.h" |
| 16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 18 #include "content/public/test/browser_test_utils.h" | 18 #include "content/public/test/browser_test_utils.h" |
| 19 #include "content/public/test/test_utils.h" | 19 #include "content/public/test/test_utils.h" |
| 20 #include "ui/base/ui_base_switches.h" | 20 #include "ui/base/ui_base_switches.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) && defined(USE_AURA) | 22 #if defined(OS_WIN) |
| 23 #include "content/public/browser/web_contents_view.h" | 23 #include "content/public/browser/web_contents_view.h" |
| 24 #include "ui/aura/root_window.h" | 24 #include "ui/aura/root_window.h" |
| 25 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 typedef InProcessBrowserTest StarViewTest; | 30 typedef InProcessBrowserTest StarViewTest; |
| 31 | 31 |
| 32 // Verify that clicking the bookmark star a second time hides the bookmark | 32 // Verify that clicking the bookmark star a second time hides the bookmark |
| (...skipping 27 matching lines...) Expand all Loading... |
| 60 star_view->OnMousePressed(pressed_event); | 60 star_view->OnMousePressed(pressed_event); |
| 61 // Hide the bubble manually. In the browser this would normally happen during | 61 // Hide the bubble manually. In the browser this would normally happen during |
| 62 // the event processing. | 62 // the event processing. |
| 63 BookmarkBubbleView::Hide(); | 63 BookmarkBubbleView::Hide(); |
| 64 base::MessageLoop::current()->RunUntilIdle(); | 64 base::MessageLoop::current()->RunUntilIdle(); |
| 65 EXPECT_FALSE(BookmarkBubbleView::IsShowing()); | 65 EXPECT_FALSE(BookmarkBubbleView::IsShowing()); |
| 66 star_view->OnMouseReleased(released_event); | 66 star_view->OnMouseReleased(released_event); |
| 67 EXPECT_FALSE(BookmarkBubbleView::IsShowing()); | 67 EXPECT_FALSE(BookmarkBubbleView::IsShowing()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 #if defined(OS_WIN) && defined(USE_AURA) | 70 #if defined(OS_WIN) |
| 71 | 71 |
| 72 class StarViewTestNoDWM : public InProcessBrowserTest { | 72 class StarViewTestNoDWM : public InProcessBrowserTest { |
| 73 public: | 73 public: |
| 74 StarViewTestNoDWM() {} | 74 StarViewTestNoDWM() {} |
| 75 | 75 |
| 76 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 76 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 77 command_line->AppendSwitch(switches::kDisableDwmComposition); | 77 command_line->AppendSwitch(switches::kDisableDwmComposition); |
| 78 } | 78 } |
| 79 }; | 79 }; |
| 80 | 80 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 region_before.left == region_after.left && | 156 region_before.left == region_after.left && |
| 157 region_before.top == region_after.top && | 157 region_before.top == region_after.top && |
| 158 region_before.right == region_after.right && | 158 region_before.right == region_after.right && |
| 159 region_before.bottom == region_after.bottom; | 159 region_before.bottom == region_after.bottom; |
| 160 ASSERT_FALSE(rects_equal); | 160 ASSERT_FALSE(rects_equal); |
| 161 } | 161 } |
| 162 | 162 |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 } // namespace | 165 } // namespace |
| OLD | NEW |