Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: chrome/browser/extensions/active_tab_unittest.cc

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 active_tab_permission_granter()->GrantIfRequested(extension.get()); 287 active_tab_permission_granter()->GrantIfRequested(extension.get());
288 288
289 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents())); 289 EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents()));
290 EXPECT_TRUE(IsAllowed(extension, google)); 290 EXPECT_TRUE(IsAllowed(extension, google));
291 291
292 // Uninstalling the extension should clear its tab permissions. 292 // Uninstalling the extension should clear its tab permissions.
293 UnloadedExtensionInfo details(extension.get(), 293 UnloadedExtensionInfo details(extension.get(),
294 UnloadedExtensionInfo::REASON_DISABLE); 294 UnloadedExtensionInfo::REASON_DISABLE);
295 content::NotificationService::current()->Notify( 295 content::NotificationService::current()->Notify(
296 chrome::NOTIFICATION_EXTENSION_UNLOADED, 296 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
297 content::Source<Profile>(Profile::FromBrowserContext( 297 content::Source<Profile>(Profile::FromBrowserContext(
298 web_contents()->GetBrowserContext())), 298 web_contents()->GetBrowserContext())),
299 content::Details<UnloadedExtensionInfo>(&details)); 299 content::Details<UnloadedExtensionInfo>(&details));
300 300
301 // Note: can't EXPECT_FALSE(IsAllowed) here because uninstalled extensions 301 // Note: can't EXPECT_FALSE(IsAllowed) here because uninstalled extensions
302 // are just that... considered to be uninstalled, and the manager might 302 // are just that... considered to be uninstalled, and the manager might
303 // just ignore them from here on. 303 // just ignore them from here on.
304 304
305 // Granting the extension again should give them back. 305 // Granting the extension again should give them back.
306 active_tab_permission_granter()->GrantIfRequested(extension.get()); 306 active_tab_permission_granter()->GrantIfRequested(extension.get());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1)); 379 EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1));
380 EXPECT_FALSE(PermissionsData::HasAPIPermissionForTab( 380 EXPECT_FALSE(PermissionsData::HasAPIPermissionForTab(
381 extension_with_tab_capture.get(), 381 extension_with_tab_capture.get(),
382 tab_id() + 1, 382 tab_id() + 1,
383 APIPermission::kTabCaptureForTab)); 383 APIPermission::kTabCaptureForTab));
384 } 384 }
385 385
386 } // namespace 386 } // namespace
387 } // namespace extensions 387 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698