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

Side by Side Diff: chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc

Issue 162423002: [WebsiteSettings] Fix bug in permission bubble manager to alter showing state when bubble is closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/website_settings/permission_bubble_manager.cc ('k') | no next file » | 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 7 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
8 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 8 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
9 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" 9 #include "chrome/browser/ui/website_settings/permission_bubble_view.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 EXPECT_EQ(&request1_, view_.permission_requests_[0]); 181 EXPECT_EQ(&request1_, view_.permission_requests_[0]);
182 EXPECT_EQ(&request2_, view_.permission_requests_[1]); 182 EXPECT_EQ(&request2_, view_.permission_requests_[1]);
183 EXPECT_TRUE(view_.permission_states_[0]); 183 EXPECT_TRUE(view_.permission_states_[0]);
184 EXPECT_FALSE(view_.permission_states_[1]); 184 EXPECT_FALSE(view_.permission_states_[1]);
185 185
186 Accept(); 186 Accept();
187 EXPECT_TRUE(request1_.granted_); 187 EXPECT_TRUE(request1_.granted_);
188 EXPECT_FALSE(request2_.granted_); 188 EXPECT_FALSE(request2_.granted_);
189 } 189 }
190 190
191 TEST_F(PermissionBubbleManagerTest, SequentialRequests) {
192 manager_->SetView(&view_);
193 manager_->AddRequest(&request1_);
194 EXPECT_TRUE(view_.shown_);
195
196 manager_->AddRequest(&request2_);
leng 2014/02/13 01:12:45 It's not clear to me why you're adding request2 tw
Greg Billock 2014/02/13 01:39:22 Thanks. This was just exercising a log line to mak
197 Accept();
198 EXPECT_TRUE(request1_.granted_);
199
200 EXPECT_FALSE(view_.shown_);
201
202 manager_->AddRequest(&request2_);
203 EXPECT_TRUE(view_.shown_);
204 Accept();
205 EXPECT_FALSE(view_.shown_);
206 EXPECT_TRUE(request2_.granted_);
207 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/permission_bubble_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698