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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc

Issue 149213003: Cleanup: Fix some lint/style errors in extensions code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 10 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/api/content_settings/content_settings_store. h" 5 #include "chrome/browser/extensions/api/content_settings/content_settings_store. h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/content_settings/content_settings_rule.h" 8 #include "chrome/browser/content_settings/content_settings_rule.h"
9 #include "chrome/browser/content_settings/content_settings_utils.h" 9 #include "chrome/browser/content_settings/content_settings_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "url/gurl.h"
12 13
13 using ::testing::Mock; 14 using ::testing::Mock;
14 15
15 namespace extensions { 16 namespace extensions {
16 17
17 namespace { 18 namespace {
18 19
19 void CheckRule(const content_settings::Rule& rule, 20 void CheckRule(const content_settings::Rule& rule,
20 const ContentSettingsPattern& primary_pattern, 21 const ContentSettingsPattern& primary_pattern,
21 const ContentSettingsPattern& secondary_pattern, 22 const ContentSettingsPattern& secondary_pattern,
(...skipping 22 matching lines...) Expand all
44 MOCK_METHOD2(OnContentSettingChanged, 45 MOCK_METHOD2(OnContentSettingChanged,
45 void(const std::string& extension_id, bool incognito)); 46 void(const std::string& extension_id, bool incognito));
46 }; 47 };
47 48
48 ContentSetting GetContentSettingFromStore( 49 ContentSetting GetContentSettingFromStore(
49 const ContentSettingsStore* store, 50 const ContentSettingsStore* store,
50 const GURL& primary_url, const GURL& secondary_url, 51 const GURL& primary_url, const GURL& secondary_url,
51 ContentSettingsType content_type, 52 ContentSettingsType content_type,
52 const std::string& resource_identifier, 53 const std::string& resource_identifier,
53 bool incognito) { 54 bool incognito) {
54 scoped_ptr<content_settings::RuleIterator> rule_iterator ( 55 scoped_ptr<content_settings::RuleIterator> rule_iterator(
55 store->GetRuleIterator(content_type, resource_identifier, incognito)); 56 store->GetRuleIterator(content_type, resource_identifier, incognito));
56 scoped_ptr<base::Value> setting( 57 scoped_ptr<base::Value> setting(
57 content_settings::GetContentSettingValueAndPatterns( 58 content_settings::GetContentSettingValueAndPatterns(
58 rule_iterator.get(), primary_url, secondary_url, NULL, NULL)); 59 rule_iterator.get(), primary_url, secondary_url, NULL, NULL));
59 return content_settings::ValueToContentSetting(setting.get()); 60 return content_settings::ValueToContentSetting(setting.get());
60 } 61 }
61 62
62 void GetSettingsForOneTypeFromStore( 63 void GetSettingsForOneTypeFromStore(
63 const ContentSettingsStore* store, 64 const ContentSettingsStore* store,
64 ContentSettingsType content_type, 65 ContentSettingsType content_type,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 244
244 // Uninstall second extension. 245 // Uninstall second extension.
245 store()->UnregisterExtension(ext_id_2); 246 store()->UnregisterExtension(ext_id_2);
246 247
247 GetSettingsForOneTypeFromStore( 248 GetSettingsForOneTypeFromStore(
248 store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); 249 store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules);
249 ASSERT_EQ(0u, rules.size()); 250 ASSERT_EQ(0u, rules.size());
250 } 251 }
251 252
252 } // namespace extensions 253 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698