OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 virtual void NavigationEntryCommitted( | 73 virtual void NavigationEntryCommitted( |
74 const content::LoadCommittedDetails& details) { | 74 const content::LoadCommittedDetails& details) { |
75 manager_->NavigationEntryCommitted(details); | 75 manager_->NavigationEntryCommitted(details); |
76 } | 76 } |
77 | 77 |
78 protected: | 78 protected: |
79 MockPermissionBubbleRequest request1_; | 79 MockPermissionBubbleRequest request1_; |
80 MockPermissionBubbleRequest request2_; | 80 MockPermissionBubbleRequest request2_; |
81 MockPermissionBubbleRequest iframe_request_same_domain_; | 81 MockPermissionBubbleRequest iframe_request_same_domain_; |
82 MockPermissionBubbleRequest iframe_request_other_domain_; | 82 MockPermissionBubbleRequest iframe_request_other_domain_; |
83 scoped_ptr<PermissionBubbleManager> manager_; | 83 std::unique_ptr<PermissionBubbleManager> manager_; |
84 scoped_ptr<MockPermissionBubbleFactory> view_factory_; | 84 std::unique_ptr<MockPermissionBubbleFactory> view_factory_; |
85 }; | 85 }; |
86 | 86 |
87 TEST_F(PermissionBubbleManagerTest, SingleRequest) { | 87 TEST_F(PermissionBubbleManagerTest, SingleRequest) { |
88 manager_->AddRequest(&request1_); | 88 manager_->AddRequest(&request1_); |
89 manager_->DisplayPendingRequests(); | 89 manager_->DisplayPendingRequests(); |
90 WaitForCoalescing(); | 90 WaitForCoalescing(); |
91 | 91 |
92 EXPECT_TRUE(view_factory_->is_visible()); | 92 EXPECT_TRUE(view_factory_->is_visible()); |
93 ASSERT_EQ(view_factory_->request_count(), 1); | 93 ASSERT_EQ(view_factory_->request_count(), 1); |
94 | 94 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 manager_->DisplayPendingRequests(); | 440 manager_->DisplayPendingRequests(); |
441 WaitForFrameLoad(); | 441 WaitForFrameLoad(); |
442 WaitForCoalescing(); | 442 WaitForCoalescing(); |
443 manager_->AddRequest(&request1_); | 443 manager_->AddRequest(&request1_); |
444 manager_->AddRequest(&iframe_request_other_domain_); | 444 manager_->AddRequest(&iframe_request_other_domain_); |
445 manager_->AddRequest(&request2_); | 445 manager_->AddRequest(&request2_); |
446 base::MessageLoop::current()->RunUntilIdle(); | 446 base::MessageLoop::current()->RunUntilIdle(); |
447 | 447 |
448 EXPECT_TRUE(view_factory_->is_visible()); | 448 EXPECT_TRUE(view_factory_->is_visible()); |
449 } | 449 } |
OLD | NEW |