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

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

Issue 2374253002: Fix bookmark bubble/star view highlighting for Harmony. (Closed)
Patch Set: fix tests, move bubble creation to toolbar Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "chrome/app/chrome_command_ids.h" 6 #include "chrome/app/chrome_command_ids.h"
7 #include "chrome/browser/extensions/api/commands/command_service.h" 7 #include "chrome/browser/extensions/api/commands/command_service.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 extensions::CommandService::Get(browser()->profile()); 42 extensions::CommandService::Get(browser()->profile());
43 43
44 // Simulate the user setting the keybinding to Ctrl+D. 44 // Simulate the user setting the keybinding to Ctrl+D.
45 command_service->UpdateKeybindingPrefs( 45 command_service->UpdateKeybindingPrefs(
46 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent, 46 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent,
47 kBookmarkKeybinding); 47 kBookmarkKeybinding);
48 48
49 // Check that the BookmarkBubbleView is shown when clicking on the star. 49 // Check that the BookmarkBubbleView is shown when clicking on the star.
50 BrowserView* browser_view = reinterpret_cast<BrowserView*>( 50 BrowserView* browser_view = reinterpret_cast<BrowserView*>(
51 browser()->window()); 51 browser()->window());
52 views::View* star_view = 52 views::View* star_view = browser_view->toolbar()->location_bar()->star_view();
53 browser_view->GetToolbarView()->location_bar()->star_view();
54 53
55 ui::MouseEvent pressed_event( 54 ui::MouseEvent pressed_event(
56 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 55 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
57 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 56 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
58 ui::MouseEvent released_event( 57 ui::MouseEvent released_event(
59 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 58 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
60 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 59 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
61 60
62 // Verify that clicking once shows the bookmark bubble. 61 // Verify that clicking once shows the bookmark bubble.
63 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); 62 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
(...skipping 19 matching lines...) Expand all
83 command_service->UpdateKeybindingPrefs( 82 command_service->UpdateKeybindingPrefs(
84 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent, 83 extension->id(), extensions::manifest_values::kBrowserActionCommandEvent,
85 kBookmarkKeybinding); 84 kBookmarkKeybinding);
86 85
87 // Check that the BookmarkBubbleView is shown when executing 86 // Check that the BookmarkBubbleView is shown when executing
88 // IDC_BOOKMARK_PAGE. 87 // IDC_BOOKMARK_PAGE.
89 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); 88 EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
90 chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE); 89 chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE);
91 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble()); 90 EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble());
92 } 91 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698