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

Side by Side Diff: chrome/browser/policy/policy_prefs_browsertest.cc

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 years, 7 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdlib> 8 #include <cstdlib>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
11 #include <sstream> 11 #include <sstream>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/files/file_util.h" 17 #include "base/files/file_util.h"
18 #include "base/json/json_reader.h" 18 #include "base/json/json_reader.h"
19 #include "base/logging.h" 19 #include "base/logging.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/memory/ptr_util.h" 21 #include "base/memory/ptr_util.h"
22 #include "base/memory/weak_ptr.h" 22 #include "base/memory/weak_ptr.h"
23 #include "base/run_loop.h" 23 #include "base/run_loop.h"
24 #include "base/stl_util.h" 24 #include "base/stl_util.h"
25 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "base/threading/thread_restrictions.h"
27 #include "base/values.h" 28 #include "base/values.h"
28 #include "build/build_config.h" 29 #include "build/build_config.h"
29 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/profiles/profile.h" 31 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/search_engines/template_url_service_factory.h" 32 #include "chrome/browser/search_engines/template_url_service_factory.h"
32 #include "chrome/browser/ui/browser.h" 33 #include "chrome/browser/ui/browser.h"
33 #include "chrome/browser/ui/tabs/tab_strip_model.h" 34 #include "chrome/browser/ui/tabs/tab_strip_model.h"
34 #include "chrome/test/base/in_process_browser_test.h" 35 #include "chrome/test/base/in_process_browser_test.h"
35 #include "chrome/test/base/search_test_utils.h" 36 #include "chrome/test/base/search_test_utils.h"
36 #include "chrome/test/base/ui_test_utils.h" 37 #include "chrome/test/base/ui_test_utils.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 }; 226 };
226 227
227 // Parses all policy test cases and makes them available in a map. 228 // Parses all policy test cases and makes them available in a map.
228 class PolicyTestCases { 229 class PolicyTestCases {
229 public: 230 public:
230 typedef std::vector<PolicyTestCase*> PolicyTestCaseVector; 231 typedef std::vector<PolicyTestCase*> PolicyTestCaseVector;
231 typedef std::map<std::string, PolicyTestCaseVector> PolicyTestCaseMap; 232 typedef std::map<std::string, PolicyTestCaseVector> PolicyTestCaseMap;
232 typedef PolicyTestCaseMap::const_iterator iterator; 233 typedef PolicyTestCaseMap::const_iterator iterator;
233 234
234 PolicyTestCases() { 235 PolicyTestCases() {
236 base::ThreadRestrictions::ScopedAllowIO allow_io;
235 base::FilePath path = ui_test_utils::GetTestFilePath( 237 base::FilePath path = ui_test_utils::GetTestFilePath(
236 base::FilePath(FILE_PATH_LITERAL("policy")), 238 base::FilePath(FILE_PATH_LITERAL("policy")),
237 base::FilePath(FILE_PATH_LITERAL("policy_test_cases.json"))); 239 base::FilePath(FILE_PATH_LITERAL("policy_test_cases.json")));
238 std::string json; 240 std::string json;
239 if (!base::ReadFileToString(path, &json)) { 241 if (!base::ReadFileToString(path, &json)) {
240 ADD_FAILURE(); 242 ADD_FAILURE();
241 return; 243 return;
242 } 244 }
243 int error_code = -1; 245 int error_code = -1;
244 std::string error_string; 246 std::string error_string;
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 768 }
767 } 769 }
768 } 770 }
769 } 771 }
770 772
771 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, 773 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
772 PolicyPrefIndicatorTest, 774 PolicyPrefIndicatorTest,
773 testing::ValuesIn(SplitPoliciesIntoChunks(10))); 775 testing::ValuesIn(SplitPoliciesIntoChunks(10)));
774 776
775 } // namespace policy 777 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/policy/test/local_policy_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698