| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class PermissionBubbleManagerTest : public ChromeRenderViewHostTestHarness { | 57 class PermissionBubbleManagerTest : public ChromeRenderViewHostTestHarness { |
| 58 public: | 58 public: |
| 59 PermissionBubbleManagerTest() | 59 PermissionBubbleManagerTest() |
| 60 : ChromeRenderViewHostTestHarness(), | 60 : ChromeRenderViewHostTestHarness(), |
| 61 request1_("test1"), | 61 request1_("test1"), |
| 62 request2_("test2"), | 62 request2_("test2"), |
| 63 iframe_request_same_domain_("iframe", | 63 iframe_request_same_domain_("iframe", |
| 64 GURL("http://www.google.com/some/url")), | 64 GURL("http://www.google.com/some/url")), |
| 65 iframe_request_other_domain_("iframe", | 65 iframe_request_other_domain_("iframe", |
| 66 GURL("http://www.youtube.com")) {} | 66 GURL("http://www.youtube.com")) {} |
| 67 virtual ~PermissionBubbleManagerTest() {} | 67 ~PermissionBubbleManagerTest() override {} |
| 68 | 68 |
| 69 virtual void SetUp() override { | 69 void SetUp() override { |
| 70 ChromeRenderViewHostTestHarness::SetUp(); | 70 ChromeRenderViewHostTestHarness::SetUp(); |
| 71 SetContents(CreateTestWebContents()); | 71 SetContents(CreateTestWebContents()); |
| 72 NavigateAndCommit(GURL("http://www.google.com")); | 72 NavigateAndCommit(GURL("http://www.google.com")); |
| 73 | 73 |
| 74 manager_.reset(new PermissionBubbleManager(web_contents())); | 74 manager_.reset(new PermissionBubbleManager(web_contents())); |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void TearDown() override { | 77 void TearDown() override { |
| 78 manager_.reset(); | 78 manager_.reset(); |
| 79 ChromeRenderViewHostTestHarness::TearDown(); | 79 ChromeRenderViewHostTestHarness::TearDown(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void ToggleAccept(int index, bool value) { | 82 void ToggleAccept(int index, bool value) { |
| 83 manager_->ToggleAccept(index, value); | 83 manager_->ToggleAccept(index, value); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void Accept() { | 86 void Accept() { |
| 87 manager_->Accept(); | 87 manager_->Accept(); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 EXPECT_FALSE(request2_.finished()); | 514 EXPECT_FALSE(request2_.finished()); |
| 515 EXPECT_FALSE(iframe_request_other_domain_.finished()); | 515 EXPECT_FALSE(iframe_request_other_domain_.finished()); |
| 516 EXPECT_TRUE(view_.shown_); | 516 EXPECT_TRUE(view_.shown_); |
| 517 Closing(); | 517 Closing(); |
| 518 EXPECT_TRUE(request2_.finished()); | 518 EXPECT_TRUE(request2_.finished()); |
| 519 EXPECT_FALSE(iframe_request_other_domain_.finished()); | 519 EXPECT_FALSE(iframe_request_other_domain_.finished()); |
| 520 Closing(); | 520 Closing(); |
| 521 EXPECT_TRUE(iframe_request_other_domain_.finished()); | 521 EXPECT_TRUE(iframe_request_other_domain_.finished()); |
| 522 EXPECT_FALSE(view_.shown_); | 522 EXPECT_FALSE(view_.shown_); |
| 523 } | 523 } |
| OLD | NEW |