| OLD | NEW |
| 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/safe_browsing/permission_reporter.h" | 5 #include "chrome/browser/safe_browsing/permission_reporter.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/test/simple_test_clock.h" | 10 #include "base/test/simple_test_clock.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 std::unique_ptr<MockPermissionPromptFactory> mock_permission_prompt_factory_; | 95 std::unique_ptr<MockPermissionPromptFactory> mock_permission_prompt_factory_; |
| 96 | 96 |
| 97 // Owned by permission reporter. | 97 // Owned by permission reporter. |
| 98 MockPermissionReportSender* mock_report_sender_; | 98 MockPermissionReportSender* mock_report_sender_; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 // Test that permission action report will be sent if the user is opted into it. | 101 // Test that permission action report will be sent if the user is opted into it. |
| 102 // TODO(kcarattini): Make this test pass with the call to Sync backends. |
| 103 // TODO(kcarattini): Address crbug/638316 to reenable this test. |
| 102 IN_PROC_BROWSER_TEST_F(PermissionReporterBrowserTest, | 104 IN_PROC_BROWSER_TEST_F(PermissionReporterBrowserTest, |
| 103 DISABLED_PermissionActionReporting) { | 105 DISABLED_PermissionActionReporting) { |
| 104 ASSERT_TRUE(embedded_test_server()->Start()); | 106 ASSERT_TRUE(embedded_test_server()->Start()); |
| 105 | 107 |
| 106 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 108 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
| 107 browser(), embedded_test_server()->GetURL("/permissions/request.html"), | 109 browser(), embedded_test_server()->GetURL("/permissions/request.html"), |
| 108 1); | 110 1); |
| 109 | 111 |
| 110 prompt_factory()->WaitForPermissionBubble(); | 112 prompt_factory()->WaitForPermissionBubble(); |
| 111 EXPECT_TRUE(prompt_factory()->is_visible()); | 113 EXPECT_TRUE(prompt_factory()->is_visible()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 123 EXPECT_EQ(embedded_test_server()->base_url().spec(), | 125 EXPECT_EQ(embedded_test_server()->base_url().spec(), |
| 124 permission_report.origin()); | 126 permission_report.origin()); |
| 125 EXPECT_EQ(PermissionReport::DESKTOP_PLATFORM, | 127 EXPECT_EQ(PermissionReport::DESKTOP_PLATFORM, |
| 126 permission_report.platform_type()); | 128 permission_report.platform_type()); |
| 127 EXPECT_EQ(PermissionReport::NO_GESTURE, permission_report.gesture()); | 129 EXPECT_EQ(PermissionReport::NO_GESTURE, permission_report.gesture()); |
| 128 EXPECT_EQ(0, permission_report.num_prior_dismissals()); | 130 EXPECT_EQ(0, permission_report.num_prior_dismissals()); |
| 129 EXPECT_EQ(0, permission_report.num_prior_ignores()); | 131 EXPECT_EQ(0, permission_report.num_prior_ignores()); |
| 130 } | 132 } |
| 131 | 133 |
| 132 } // namespace safe_browsing | 134 } // namespace safe_browsing |
| OLD | NEW |