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

Side by Side Diff: chrome/browser/extensions/api/permissions/permissions_apitest.cc

Issue 12212047: Linux/ChromeOS Chromium style checker cleanup, chrome/browser/extensions edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 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/permissions/permissions_api.h" 5 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_prefs.h" 7 #include "chrome/browser/extensions/extension_prefs.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 10 matching lines...) Expand all
21 21
22 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { 22 static void AddPattern(URLPatternSet* extent, const std::string& pattern) {
23 int schemes = URLPattern::SCHEME_ALL; 23 int schemes = URLPattern::SCHEME_ALL;
24 extent->AddPattern(URLPattern(schemes, pattern)); 24 extent->AddPattern(URLPattern(schemes, pattern));
25 } 25 }
26 26
27 } // namespace 27 } // namespace
28 28
29 class ExperimentalApiTest : public ExtensionApiTest { 29 class ExperimentalApiTest : public ExtensionApiTest {
30 public: 30 public:
31 void SetUpCommandLine(CommandLine* command_line) { 31 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
32 ExtensionApiTest::SetUpCommandLine(command_line); 32 ExtensionApiTest::SetUpCommandLine(command_line);
33 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 33 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
34 } 34 }
35 }; 35 };
36 36
37 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PermissionsFail) { 37 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PermissionsFail) {
38 ASSERT_TRUE(RunExtensionTest("permissions/disabled")) << message_; 38 ASSERT_TRUE(RunExtensionTest("permissions/disabled")) << message_;
39 39
40 // Since the experimental APIs require a flag, this will fail even though 40 // Since the experimental APIs require a flag, this will fail even though
41 // it's enabled. 41 // it's enabled.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // TODO(kalman): ugh, it would be nice to test this condition, but it seems 148 // TODO(kalman): ugh, it would be nice to test this condition, but it seems
149 // like there's somehow a race here where the prefs aren't updated in time 149 // like there's somehow a race here where the prefs aren't updated in time
150 // with the "allow file access" bit, so we'll just have to trust that 150 // with the "allow file access" bit, so we'll just have to trust that
151 // RunExtensionTest (unlike RunExtensionTestNoFileAccess) does indeed 151 // RunExtensionTest (unlike RunExtensionTestNoFileAccess) does indeed
152 // not set the allow file access bit. Otherwise this test doesn't mean 152 // not set the allow file access bit. Otherwise this test doesn't mean
153 // a whole lot (i.e. file access works - but it'd better not be the case 153 // a whole lot (i.e. file access works - but it'd better not be the case
154 // that the extension actually has file access, since that'd be the bug 154 // that the extension actually has file access, since that'd be the bug
155 // that this is supposed to be testing). 155 // that this is supposed to be testing).
156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd")); 156 //EXPECT_TRUE(prefs->AllowFileAccess("hlonmbgfjccgolnaboonlakjckinmhmd"));
157 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698