Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: chrome/browser/ui/views/extensions/bookmark_override_browsertest.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/app/chrome_command_ids.h" 5 #include "chrome/app/chrome_command_ids.h"
6 #include "chrome/browser/extensions/api/commands/command_service.h" 6 #include "chrome/browser/extensions/api/commands/command_service.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 kBookmarkKeybinding); 45 kBookmarkKeybinding);
46 46
47 // Check that the BookmarkBubbleView is shown when clicking on the star. 47 // Check that the BookmarkBubbleView is shown when clicking on the star.
48 BrowserView* browser_view = reinterpret_cast<BrowserView*>( 48 BrowserView* browser_view = reinterpret_cast<BrowserView*>(
49 browser()->window()); 49 browser()->window());
50 views::View* star_view = 50 views::View* star_view =
51 browser_view->GetToolbarView()->location_bar()->star_view(); 51 browser_view->GetToolbarView()->location_bar()->star_view();
52 52
53 ui::MouseEvent pressed_event( 53 ui::MouseEvent pressed_event(
54 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 54 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
55 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 55 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
56 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
56 ui::MouseEvent released_event( 57 ui::MouseEvent released_event(
57 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 58 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
58 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 59 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
60 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
59 61
60 // Verify that clicking once shows the bookmark bubble. 62 // Verify that clicking once shows the bookmark bubble.
61 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); 63 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
62 star_view->OnMousePressed(pressed_event); 64 star_view->OnMousePressed(pressed_event);
63 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); 65 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
64 star_view->OnMouseReleased(released_event); 66 star_view->OnMouseReleased(released_event);
65 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble()); 67 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble());
66 } 68 }
67 69
68 // Test that invoking the IDC_BOOKMARK_PAGE command (as done by the wrench menu) 70 // Test that invoking the IDC_BOOKMARK_PAGE command (as done by the wrench menu)
(...skipping 12 matching lines...) Expand all
81 command_service->UpdateKeybindingPrefs( 83 command_service->UpdateKeybindingPrefs(
82 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent, 84 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent,
83 kBookmarkKeybinding); 85 kBookmarkKeybinding);
84 86
85 // Check that the BookmarkBubbleView is shown when executing 87 // Check that the BookmarkBubbleView is shown when executing
86 // IDC_BOOKMARK_PAGE. 88 // IDC_BOOKMARK_PAGE.
87 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); 89 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
88 chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE); 90 chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE);
89 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble()); 91 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble());
90 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698