| 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/plugins/flash_temporary_permission_tracker.h" | 5 #include "chrome/browser/plugins/flash_temporary_permission_tracker.h" |
| 6 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 6 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 7 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
| 8 #include "content/public/browser/permission_type.h" | |
| 9 #include "content/public/browser/render_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/test/test_renderer_host.h" | 10 #include "content/public/test/test_renderer_host.h" |
| 12 #include "content/public/test/web_contents_tester.h" | 11 #include "content/public/test/web_contents_tester.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 const char* kOrigin1 = "https://google.com"; | 17 const char* kOrigin1 = "https://google.com"; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 EXPECT_TRUE(tracker()->IsFlashEnabled(GURL(kOrigin1))); | 142 EXPECT_TRUE(tracker()->IsFlashEnabled(GURL(kOrigin1))); |
| 144 | 143 |
| 145 // Now destroying the original WebContents should no longer revoke the grant. | 144 // Now destroying the original WebContents should no longer revoke the grant. |
| 146 temporary_web_contents.reset(); | 145 temporary_web_contents.reset(); |
| 147 EXPECT_TRUE(tracker()->IsFlashEnabled(GURL(kOrigin1))); | 146 EXPECT_TRUE(tracker()->IsFlashEnabled(GURL(kOrigin1))); |
| 148 | 147 |
| 149 // And destroying the second WebContents should revoke the grant. | 148 // And destroying the second WebContents should revoke the grant. |
| 150 second_web_contents.reset(); | 149 second_web_contents.reset(); |
| 151 EXPECT_FALSE(tracker()->IsFlashEnabled(GURL(kOrigin1))); | 150 EXPECT_FALSE(tracker()->IsFlashEnabled(GURL(kOrigin1))); |
| 152 } | 151 } |
| OLD | NEW |