| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/website_settings/mock_permission_bubble_request.h" | 8 #include "chrome/browser/ui/website_settings/mock_permission_bubble_request.h" |
| 9 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 9 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | 10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 void ToggleAccept(int index, bool value) { | 80 void ToggleAccept(int index, bool value) { |
| 81 manager_->ToggleAccept(index, value); | 81 manager_->ToggleAccept(index, value); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void Accept() { | 84 void Accept() { |
| 85 manager_->Accept(); | 85 manager_->Accept(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WaitForCoalescing() { | 88 void WaitForCoalescing() { |
| 89 manager_->DocumentOnLoadCompletedInMainFrame(0); | 89 manager_->DocumentOnLoadCompletedInMainFrame(); |
| 90 base::MessageLoop::current()->RunUntilIdle(); | 90 base::MessageLoop::current()->RunUntilIdle(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 virtual void NavigationEntryCommitted( | 93 virtual void NavigationEntryCommitted( |
| 94 const content::LoadCommittedDetails& details) { | 94 const content::LoadCommittedDetails& details) { |
| 95 manager_->NavigationEntryCommitted(details); | 95 manager_->NavigationEntryCommitted(details); |
| 96 } | 96 } |
| 97 | 97 |
| 98 protected: | 98 protected: |
| 99 MockPermissionBubbleRequest request1_; | 99 MockPermissionBubbleRequest request1_; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 EXPECT_TRUE(view_.shown_); | 324 EXPECT_TRUE(view_.shown_); |
| 325 ASSERT_EQ(1u, view_.permission_requests_.size()); | 325 ASSERT_EQ(1u, view_.permission_requests_.size()); |
| 326 | 326 |
| 327 NavigateAndCommit(GURL("http://www2.google.com/")); | 327 NavigateAndCommit(GURL("http://www2.google.com/")); |
| 328 WaitForCoalescing(); | 328 WaitForCoalescing(); |
| 329 | 329 |
| 330 EXPECT_TRUE(request1_.finished()); | 330 EXPECT_TRUE(request1_.finished()); |
| 331 EXPECT_TRUE(request2_.finished()); | 331 EXPECT_TRUE(request2_.finished()); |
| 332 } | 332 } |
| OLD | NEW |