| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 active_tab_permission_granter()->GrantIfRequested(extension.get()); | 289 active_tab_permission_granter()->GrantIfRequested(extension.get()); |
| 290 | 290 |
| 291 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents())); | 291 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents())); |
| 292 EXPECT_TRUE(IsAllowed(extension, google)); | 292 EXPECT_TRUE(IsAllowed(extension, google)); |
| 293 | 293 |
| 294 // Uninstalling the extension should clear its tab permissions. | 294 // Uninstalling the extension should clear its tab permissions. |
| 295 ExtensionRegistry* registry = | 295 ExtensionRegistry* registry = |
| 296 ExtensionRegistry::Get(web_contents()->GetBrowserContext()); | 296 ExtensionRegistry::Get(web_contents()->GetBrowserContext()); |
| 297 registry->TriggerOnUnloaded(extension.get(), | 297 registry->TriggerOnUnloaded(extension.get(), |
| 298 UnloadedExtensionInfo::REASON_DISABLE); | 298 UnloadedExtensionReason::DISABLE); |
| 299 | 299 |
| 300 // Note: can't EXPECT_FALSE(IsAllowed) here because uninstalled extensions | 300 // Note: can't EXPECT_FALSE(IsAllowed) here because uninstalled extensions |
| 301 // are just that... considered to be uninstalled, and the manager might | 301 // are just that... considered to be uninstalled, and the manager might |
| 302 // just ignore them from here on. | 302 // just ignore them from here on. |
| 303 | 303 |
| 304 // Granting the extension again should give them back. | 304 // Granting the extension again should give them back. |
| 305 active_tab_permission_granter()->GrantIfRequested(extension.get()); | 305 active_tab_permission_granter()->GrantIfRequested(extension.get()); |
| 306 | 306 |
| 307 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents())); | 307 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents())); |
| 308 EXPECT_TRUE(IsAllowed(extension, google)); | 308 EXPECT_TRUE(IsAllowed(extension, google)); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab( | 375 EXPECT_TRUE(permissions_data->HasAPIPermissionForTab( |
| 376 tab_id(), APIPermission::kTabCaptureForTab)); | 376 tab_id(), APIPermission::kTabCaptureForTab)); |
| 377 | 377 |
| 378 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); | 378 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); |
| 379 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab( | 379 EXPECT_FALSE(permissions_data->HasAPIPermissionForTab( |
| 380 tab_id() + 1, APIPermission::kTabCaptureForTab)); | 380 tab_id() + 1, APIPermission::kTabCaptureForTab)); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace | 383 } // namespace |
| 384 } // namespace extensions | 384 } // namespace extensions |
| OLD | NEW |