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

Side by Side Diff: chrome/browser/extensions/api/declarative_content/request_content_script_apitest.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/extensions/test_extension_dir.h" 9 #include "chrome/browser/extensions/test_extension_dir.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
13 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
14 #include "extensions/test/extension_test_message_listener.h" 14 #include "extensions/test/extension_test_message_listener.h"
15 #include "net/test/embedded_test_server/embedded_test_server.h" 15 #include "net/test/embedded_test_server/embedded_test_server.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace extensions { 18 namespace extensions {
19 19
20 namespace { 20 namespace {
21 21
22 // Manifest permissions injected into |kManifest|: 22 // Manifest permissions injected into |kManifest|:
23 const char* kPermissions[] = { 23 const char* const kPermissions[] = {
24 "*://*/*", // ALL 24 "*://*/*", // ALL
25 "http://127.0.0.1/*", // PARTICULAR 25 "http://127.0.0.1/*", // PARTICULAR
26 "http://nowhere.com/*" // NOWHERE 26 "http://nowhere.com/*" // NOWHERE
27 }; 27 };
28 28
29 // Script matchers for injected into |kBackgroundScriptSource|: 29 // Script matchers for injected into |kBackgroundScriptSource|:
30 const char* kScriptMatchers[] = { 30 const char* const kScriptMatchers[] = {
31 "{ pageUrl: { hostContains: '' } }", // ALL 31 "{ pageUrl: { hostContains: '' } }", // ALL
32 "{ pageUrl: { hostEquals: '127.0.0.1' } }", // PARTICULAR 32 "{ pageUrl: { hostEquals: '127.0.0.1' } }", // PARTICULAR
33 "{ pageUrl: { hostEquals: 'nowhere.com' } }" // NOWHERE 33 "{ pageUrl: { hostEquals: 'nowhere.com' } }" // NOWHERE
34 }; 34 };
35 35
36 enum PermissionOrMatcherType { 36 enum PermissionOrMatcherType {
37 ALL = 0, 37 ALL = 0,
38 PARTICULAR, 38 PARTICULAR,
39 NOWHERE 39 NOWHERE
40 }; 40 };
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 EXPECT_TRUE(RunTest(PARTICULAR, NOWHERE, false)); 215 EXPECT_TRUE(RunTest(PARTICULAR, NOWHERE, false));
216 216
217 // TODO(markdittmer): Add more tests: 217 // TODO(markdittmer): Add more tests:
218 // - Inject script with multiple files 218 // - Inject script with multiple files
219 // - Inject multiple scripts 219 // - Inject multiple scripts
220 // - Match on CSS selector conditions 220 // - Match on CSS selector conditions
221 // - Match all frames in document containing frames 221 // - Match all frames in document containing frames
222 } 222 }
223 223
224 } // namespace extensions 224 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698