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

Side by Side Diff: chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/intent_picker_bubble_view.h" 5 #include "chrome/browser/ui/views/intent_picker_bubble_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 29 matching lines...) Expand all
40 // Pushing a couple of fake apps just to check they are created on the UI. 40 // Pushing a couple of fake apps just to check they are created on the UI.
41 app_info_.emplace_back("dank app 1", gfx::Image()); 41 app_info_.emplace_back("dank app 1", gfx::Image());
42 app_info_.emplace_back("dank app 2", gfx::Image()); 42 app_info_.emplace_back("dank app 2", gfx::Image());
43 43
44 if (use_icons) 44 if (use_icons)
45 FillAppListWithDummyIcons(); 45 FillAppListWithDummyIcons();
46 46
47 // We create |web_contents| since the Bubble UI has an Observer that 47 // We create |web_contents| since the Bubble UI has an Observer that
48 // depends on this, otherwise it wouldn't work. 48 // depends on this, otherwise it wouldn't work.
49 GURL url("http://www.google.com"); 49 GURL url("http://www.google.com");
50 WebContents* web_contents = browser()->OpenURL(OpenURLParams( 50 WebContents* web_contents = browser()->OpenURL(
51 url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); 51 OpenURLParams(url, Referrer(), WindowOpenDisposition::CURRENT_TAB,
52 ui::PAGE_TRANSITION_TYPED, false));
52 53
53 bubble_ = IntentPickerBubbleView::CreateBubbleView( 54 bubble_ = IntentPickerBubbleView::CreateBubbleView(
54 app_info_, base::Bind(&IntentPickerBubbleViewTest::OnBubbleClosed, 55 app_info_, base::Bind(&IntentPickerBubbleViewTest::OnBubbleClosed,
55 base::Unretained(this)), 56 base::Unretained(this)),
56 web_contents); 57 web_contents);
57 } 58 }
58 59
59 void FillAppListWithDummyIcons() { 60 void FillAppListWithDummyIcons() {
60 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 61 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
61 gfx::Image dummy_icon = rb.GetImageNamed(IDR_CLOSE); 62 gfx::Image dummy_icon = rb.GetImageNamed(IDR_CLOSE);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 app->GetImage(views::Button::ButtonState::STATE_NORMAL).isNull()) << i; 96 app->GetImage(views::Button::ButtonState::STATE_NORMAL).isNull()) << i;
96 } 97 }
97 } 98 }
98 99
99 // Verifies that the bubble contains as many rows as the input. Populated the 100 // Verifies that the bubble contains as many rows as the input. Populated the
100 // bubble with an arbitrary image in every row. 101 // bubble with an arbitrary image in every row.
101 TEST_F(IntentPickerBubbleViewTest, LabelsPtrVectorSize) { 102 TEST_F(IntentPickerBubbleViewTest, LabelsPtrVectorSize) {
102 CreateBubbleView(true); 103 CreateBubbleView(true);
103 EXPECT_EQ(app_info_.size(), bubble_->app_info_.size()); 104 EXPECT_EQ(app_info_.size(), bubble_->app_info_.size());
104 } 105 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/global_menu_bar_x11.cc ('k') | chrome/browser/ui/views/keyboard_access_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698