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

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

Issue 10630021: Modify experimental identity flow to display scope descriptions and details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 5 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 "chrome/browser/extensions/extension_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 service_->ReloadExtensions(); 1572 service_->ReloadExtensions();
1573 1573
1574 EXPECT_EQ(1u, service_->disabled_extensions()->size()); 1574 EXPECT_EQ(1u, service_->disabled_extensions()->size());
1575 extension = *service_->disabled_extensions()->begin(); 1575 extension = *service_->disabled_extensions()->begin();
1576 1576
1577 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); 1577 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id));
1578 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); 1578 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id));
1579 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id)); 1579 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id));
1580 1580
1581 // Now grant and re-enable the extension, making sure the prefs are updated. 1581 // Now grant and re-enable the extension, making sure the prefs are updated.
1582 service_->GrantPermissionsAndEnableExtension(extension); 1582 service_->GrantPermissionsAndEnableExtension(extension, false);
1583 1583
1584 ASSERT_FALSE(prefs->IsExtensionDisabled(extension_id)); 1584 ASSERT_FALSE(prefs->IsExtensionDisabled(extension_id));
1585 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id)); 1585 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id));
1586 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id)); 1586 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id));
1587 1587
1588 scoped_refptr<PermissionSet> current_perms( 1588 scoped_refptr<PermissionSet> current_perms(
1589 prefs->GetGrantedPermissions(extension_id)); 1589 prefs->GetGrantedPermissions(extension_id));
1590 ASSERT_TRUE(current_perms.get()); 1590 ASSERT_TRUE(current_perms.get());
1591 ASSERT_FALSE(current_perms->IsEmpty()); 1591 ASSERT_FALSE(current_perms->IsEmpty());
1592 ASSERT_FALSE(current_perms->HasEffectiveFullAccess()); 1592 ASSERT_FALSE(current_perms->HasEffectiveFullAccess());
(...skipping 22 matching lines...) Expand all
1615 service_->ReloadExtensions(); 1615 service_->ReloadExtensions();
1616 1616
1617 EXPECT_EQ(1u, service_->disabled_extensions()->size()); 1617 EXPECT_EQ(1u, service_->disabled_extensions()->size());
1618 extension = *service_->disabled_extensions()->begin(); 1618 extension = *service_->disabled_extensions()->begin();
1619 1619
1620 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); 1620 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id));
1621 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); 1621 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id));
1622 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id)); 1622 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id));
1623 1623
1624 // Now grant and re-enable the extension, making sure the prefs are updated. 1624 // Now grant and re-enable the extension, making sure the prefs are updated.
1625 service_->GrantPermissionsAndEnableExtension(extension); 1625 service_->GrantPermissionsAndEnableExtension(extension, false);
1626 1626
1627 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id)); 1627 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id));
1628 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id)); 1628 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id));
1629 1629
1630 current_perms = prefs->GetGrantedPermissions(extension_id); 1630 current_perms = prefs->GetGrantedPermissions(extension_id);
1631 ASSERT_TRUE(current_perms.get()); 1631 ASSERT_TRUE(current_perms.get());
1632 ASSERT_FALSE(current_perms->IsEmpty()); 1632 ASSERT_FALSE(current_perms->IsEmpty());
1633 ASSERT_FALSE(current_perms->HasEffectiveFullAccess()); 1633 ASSERT_FALSE(current_perms->HasEffectiveFullAccess());
1634 ASSERT_EQ(expected_api_permissions, current_perms->apis()); 1634 ASSERT_EQ(expected_api_permissions, current_perms->apis());
1635 ASSERT_EQ(expected_host_permissions, current_perms->effective_hosts()); 1635 ASSERT_EQ(expected_host_permissions, current_perms->effective_hosts());
(...skipping 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", 5213 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0",
5214 data_dir_.AppendASCII("hosted_app.crx")); 5214 data_dir_.AppendASCII("hosted_app.crx"));
5215 5215
5216 service_->CheckForExternalUpdates(); 5216 service_->CheckForExternalUpdates();
5217 loop_.RunAllPending(); 5217 loop_.RunAllPending();
5218 5218
5219 ASSERT_TRUE(service_->PopulateExtensionGlobalError( 5219 ASSERT_TRUE(service_->PopulateExtensionGlobalError(
5220 extension_global_error.get())); 5220 extension_global_error.get()));
5221 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); 5221 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size());
5222 } 5222 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/permissions_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698