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

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: Created 8 years, 6 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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 service_->ReloadExtensions(); 1569 service_->ReloadExtensions();
1570 1570
1571 EXPECT_EQ(1u, service_->disabled_extensions()->size()); 1571 EXPECT_EQ(1u, service_->disabled_extensions()->size());
1572 extension = *service_->disabled_extensions()->begin(); 1572 extension = *service_->disabled_extensions()->begin();
1573 1573
1574 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); 1574 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id));
1575 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); 1575 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id));
1576 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id)); 1576 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id));
1577 1577
1578 // Now grant and re-enable the extension, making sure the prefs are updated. 1578 // Now grant and re-enable the extension, making sure the prefs are updated.
1579 service_->GrantPermissionsAndEnableExtension(extension); 1579 service_->GrantPermissionsAndEnableExtension(extension, false);
1580 1580
1581 ASSERT_FALSE(prefs->IsExtensionDisabled(extension_id)); 1581 ASSERT_FALSE(prefs->IsExtensionDisabled(extension_id));
1582 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id)); 1582 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id));
1583 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id)); 1583 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id));
1584 1584
1585 scoped_refptr<ExtensionPermissionSet> current_perms( 1585 scoped_refptr<ExtensionPermissionSet> current_perms(
1586 prefs->GetGrantedPermissions(extension_id)); 1586 prefs->GetGrantedPermissions(extension_id));
1587 ASSERT_TRUE(current_perms.get()); 1587 ASSERT_TRUE(current_perms.get());
1588 ASSERT_FALSE(current_perms->IsEmpty()); 1588 ASSERT_FALSE(current_perms->IsEmpty());
1589 ASSERT_FALSE(current_perms->HasEffectiveFullAccess()); 1589 ASSERT_FALSE(current_perms->HasEffectiveFullAccess());
(...skipping 22 matching lines...) Expand all
1612 service_->ReloadExtensions(); 1612 service_->ReloadExtensions();
1613 1613
1614 EXPECT_EQ(1u, service_->disabled_extensions()->size()); 1614 EXPECT_EQ(1u, service_->disabled_extensions()->size());
1615 extension = *service_->disabled_extensions()->begin(); 1615 extension = *service_->disabled_extensions()->begin();
1616 1616
1617 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); 1617 ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id));
1618 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); 1618 ASSERT_FALSE(service_->IsExtensionEnabled(extension_id));
1619 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id)); 1619 ASSERT_TRUE(prefs->DidExtensionEscalatePermissions(extension_id));
1620 1620
1621 // Now grant and re-enable the extension, making sure the prefs are updated. 1621 // Now grant and re-enable the extension, making sure the prefs are updated.
1622 service_->GrantPermissionsAndEnableExtension(extension); 1622 service_->GrantPermissionsAndEnableExtension(extension, false);
1623 1623
1624 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id)); 1624 ASSERT_TRUE(service_->IsExtensionEnabled(extension_id));
1625 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id)); 1625 ASSERT_FALSE(prefs->DidExtensionEscalatePermissions(extension_id));
1626 1626
1627 current_perms = prefs->GetGrantedPermissions(extension_id); 1627 current_perms = prefs->GetGrantedPermissions(extension_id);
1628 ASSERT_TRUE(current_perms.get()); 1628 ASSERT_TRUE(current_perms.get());
1629 ASSERT_FALSE(current_perms->IsEmpty()); 1629 ASSERT_FALSE(current_perms->IsEmpty());
1630 ASSERT_FALSE(current_perms->HasEffectiveFullAccess()); 1630 ASSERT_FALSE(current_perms->HasEffectiveFullAccess());
1631 ASSERT_EQ(expected_api_permissions, current_perms->apis()); 1631 ASSERT_EQ(expected_api_permissions, current_perms->apis());
1632 ASSERT_EQ(expected_host_permissions, current_perms->effective_hosts()); 1632 ASSERT_EQ(expected_host_permissions, current_perms->effective_hosts());
(...skipping 3555 matching lines...) Expand 10 before | Expand all | Expand 10 after
5188 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", 5188 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0",
5189 data_dir_.AppendASCII("hosted_app.crx")); 5189 data_dir_.AppendASCII("hosted_app.crx"));
5190 5190
5191 service_->CheckForExternalUpdates(); 5191 service_->CheckForExternalUpdates();
5192 loop_.RunAllPending(); 5192 loop_.RunAllPending();
5193 5193
5194 ASSERT_TRUE(service_->PopulateExtensionGlobalError( 5194 ASSERT_TRUE(service_->PopulateExtensionGlobalError(
5195 extension_global_error.get())); 5195 extension_global_error.get()));
5196 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); 5196 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size());
5197 } 5197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698