| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 : current_channel(chrome::VersionInfo::CHANNEL_DEV), | 70 : current_channel(chrome::VersionInfo::CHANNEL_DEV), |
| 71 extension(CreateTestExtension("deadbeef", true, false)), | 71 extension(CreateTestExtension("deadbeef", true, false)), |
| 72 another_extension(CreateTestExtension("feedbeef", true, false)), | 72 another_extension(CreateTestExtension("feedbeef", true, false)), |
| 73 extension_without_active_tab(CreateTestExtension("badbeef", | 73 extension_without_active_tab(CreateTestExtension("badbeef", |
| 74 false, | 74 false, |
| 75 false)), | 75 false)), |
| 76 extension_with_tab_capture(CreateTestExtension("cafebeef", | 76 extension_with_tab_capture(CreateTestExtension("cafebeef", |
| 77 true, | 77 true, |
| 78 true)) {} | 78 true)) {} |
| 79 | 79 |
| 80 virtual void SetUp() OVERRIDE { | 80 virtual void SetUp() override { |
| 81 ChromeRenderViewHostTestHarness::SetUp(); | 81 ChromeRenderViewHostTestHarness::SetUp(); |
| 82 TabHelper::CreateForWebContents(web_contents()); | 82 TabHelper::CreateForWebContents(web_contents()); |
| 83 } | 83 } |
| 84 | 84 |
| 85 int tab_id() { | 85 int tab_id() { |
| 86 return SessionTabHelper::IdForTab(web_contents()); | 86 return SessionTabHelper::IdForTab(web_contents()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 ActiveTabPermissionGranter* active_tab_permission_granter() { | 89 ActiveTabPermissionGranter* active_tab_permission_granter() { |
| 90 return extensions::TabHelper::FromWebContents(web_contents())-> | 90 return extensions::TabHelper::FromWebContents(web_contents())-> |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab( | 372 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab( |
| 373 tab_id(), APIPermission::kTabCaptureForTab)); | 373 tab_id(), APIPermission::kTabCaptureForTab)); |
| 374 | 374 |
| 375 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); | 375 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); |
| 376 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab( | 376 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab( |
| 377 tab_id() + 1, APIPermission::kTabCaptureForTab)); | 377 tab_id() + 1, APIPermission::kTabCaptureForTab)); |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace | 380 } // namespace |
| 381 } // namespace extensions | 381 } // namespace extensions |
| OLD | NEW |