OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 const base::FilePath::CharType kGoodCrxName[] = FILE_PATH_LITERAL("good.crx"); | 171 const base::FilePath::CharType kGoodCrxName[] = FILE_PATH_LITERAL("good.crx"); |
172 const base::FilePath::CharType kAdBlockCrxName[] = | 172 const base::FilePath::CharType kAdBlockCrxName[] = |
173 FILE_PATH_LITERAL("adblock.crx"); | 173 FILE_PATH_LITERAL("adblock.crx"); |
174 const base::FilePath::CharType kHostedAppCrxName[] = | 174 const base::FilePath::CharType kHostedAppCrxName[] = |
175 FILE_PATH_LITERAL("hosted_app.crx"); | 175 FILE_PATH_LITERAL("hosted_app.crx"); |
176 | 176 |
177 const char kGoodCrxId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; | 177 const char kGoodCrxId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; |
178 const char kAdBlockCrxId[] = "dojnnbeimaimaojcialkkgajdnefpgcn"; | 178 const char kAdBlockCrxId[] = "dojnnbeimaimaojcialkkgajdnefpgcn"; |
179 const char kHostedAppCrxId[] = "kbmnembihfiondgfjekmnmcbddelicoi"; | 179 const char kHostedAppCrxId[] = "kbmnembihfiondgfjekmnmcbddelicoi"; |
180 | 180 |
181 const base::FilePath::CharType kGoodCrxManifestName[] = | |
182 FILE_PATH_LITERAL("good_update_manifest.xml"); | |
183 const base::FilePath::CharType kGood2CrxManifestName[] = | 181 const base::FilePath::CharType kGood2CrxManifestName[] = |
184 FILE_PATH_LITERAL("good2_update_manifest.xml"); | 182 FILE_PATH_LITERAL("good2_update_manifest.xml"); |
185 const base::FilePath::CharType kGoodV1CrxManifestName[] = | 183 const base::FilePath::CharType kGoodV1CrxManifestName[] = |
186 FILE_PATH_LITERAL("good_v1_update_manifest.xml"); | 184 FILE_PATH_LITERAL("good_v1_update_manifest.xml"); |
187 const base::FilePath::CharType kGoodUnpackedExt[] = | 185 const base::FilePath::CharType kGoodUnpackedExt[] = |
188 FILE_PATH_LITERAL("good_unpacked"); | 186 FILE_PATH_LITERAL("good_unpacked"); |
189 const base::FilePath::CharType kAppUnpackedExt[] = | 187 const base::FilePath::CharType kAppUnpackedExt[] = |
190 FILE_PATH_LITERAL("app"); | 188 FILE_PATH_LITERAL("app"); |
| 189 |
| 190 #if !defined(OS_MACOSX) |
191 const base::FilePath::CharType kUnpackedFullscreenAppName[] = | 191 const base::FilePath::CharType kUnpackedFullscreenAppName[] = |
192 FILE_PATH_LITERAL("fullscreen_app"); | 192 FILE_PATH_LITERAL("fullscreen_app"); |
| 193 #endif // !defined(OS_MACOSX) |
193 | 194 |
194 // Filters requests to the hosts in |urls| and redirects them to the test data | 195 // Filters requests to the hosts in |urls| and redirects them to the test data |
195 // dir through URLRequestMockHTTPJobs. | 196 // dir through URLRequestMockHTTPJobs. |
196 void RedirectHostsToTestData(const char* const urls[], size_t size) { | 197 void RedirectHostsToTestData(const char* const urls[], size_t size) { |
197 // Map the given hosts to the test data dir. | 198 // Map the given hosts to the test data dir. |
198 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); | 199 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); |
199 base::FilePath base_path; | 200 base::FilePath base_path; |
200 PathService::Get(chrome::DIR_TEST_DATA, &base_path); | 201 PathService::Get(chrome::DIR_TEST_DATA, &base_path); |
201 for (size_t i = 0; i < size; ++i) { | 202 for (size_t i = 0; i < size; ++i) { |
202 const GURL url(urls[i]); | 203 const GURL url(urls[i]); |
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 chrome_variations::VariationsService::GetVariationsServerURL( | 2727 chrome_variations::VariationsService::GetVariationsServerURL( |
2727 g_browser_process->local_state()); | 2728 g_browser_process->local_state()); |
2728 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2729 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2729 std::string value; | 2730 std::string value; |
2730 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2731 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2731 EXPECT_EQ("restricted", value); | 2732 EXPECT_EQ("restricted", value); |
2732 } | 2733 } |
2733 #endif | 2734 #endif |
2734 | 2735 |
2735 } // namespace policy | 2736 } // namespace policy |
OLD | NEW |