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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 1118773004: [chrome/browser/chromeos/policy] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments->2 Created 5 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/system/chromeos/session/logout_confirmation_controller.h" 11 #include "ash/system/chromeos/session/logout_confirmation_controller.h"
12 #include "ash/system/chromeos/session/logout_confirmation_dialog.h" 12 #include "ash/system/chromeos/session/logout_confirmation_dialog.h"
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/bind_helpers.h" 15 #include "base/bind_helpers.h"
16 #include "base/callback.h" 16 #include "base/callback.h"
17 #include "base/command_line.h" 17 #include "base/command_line.h"
18 #include "base/files/file_path.h" 18 #include "base/files/file_path.h"
19 #include "base/files/file_util.h" 19 #include "base/files/file_util.h"
20 #include "base/json/json_reader.h" 20 #include "base/json/json_reader.h"
21 #include "base/json/json_writer.h" 21 #include "base/json/json_writer.h"
22 #include "base/location.h" 22 #include "base/location.h"
23 #include "base/macros.h" 23 #include "base/macros.h"
24 #include "base/memory/ref_counted.h" 24 #include "base/memory/ref_counted.h"
25 #include "base/memory/scoped_ptr.h" 25 #include "base/memory/scoped_ptr.h"
26 #include "base/message_loop/message_loop.h" 26 #include "base/message_loop/message_loop.h"
27 #include "base/message_loop/message_loop_proxy.h"
28 #include "base/path_service.h" 27 #include "base/path_service.h"
29 #include "base/prefs/pref_change_registrar.h" 28 #include "base/prefs/pref_change_registrar.h"
30 #include "base/prefs/pref_service.h" 29 #include "base/prefs/pref_service.h"
31 #include "base/run_loop.h" 30 #include "base/run_loop.h"
32 #include "base/sequenced_task_runner.h" 31 #include "base/sequenced_task_runner.h"
33 #include "base/strings/string_number_conversions.h" 32 #include "base/strings/string_number_conversions.h"
34 #include "base/strings/string_util.h" 33 #include "base/strings/string_util.h"
35 #include "base/strings/stringprintf.h" 34 #include "base/strings/stringprintf.h"
36 #include "base/strings/utf_string_conversions.h" 35 #include "base/strings/utf_string_conversions.h"
37 #include "base/synchronization/lock.h" 36 #include "base/synchronization/lock.h"
37 #include "base/thread_task_runner_handle.h"
38 #include "base/threading/sequenced_worker_pool.h" 38 #include "base/threading/sequenced_worker_pool.h"
39 #include "base/values.h" 39 #include "base/values.h"
40 #include "chrome/browser/browser_process.h" 40 #include "chrome/browser/browser_process.h"
41 #include "chrome/browser/chrome_notification_types.h" 41 #include "chrome/browser/chrome_notification_types.h"
42 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h" 42 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h"
43 #include "chrome/browser/chromeos/extensions/external_cache.h" 43 #include "chrome/browser/chromeos/extensions/external_cache.h"
44 #include "chrome/browser/chromeos/input_method/input_method_util.h" 44 #include "chrome/browser/chromeos/input_method/input_method_util.h"
45 #include "chrome/browser/chromeos/login/existing_user_controller.h" 45 #include "chrome/browser/chromeos/login/existing_user_controller.h"
46 #include "chrome/browser/chromeos/login/screens/base_screen.h" 46 #include "chrome/browser/chromeos/login/screens/base_screen.h"
47 #include "chrome/browser/chromeos/login/signin_specifics.h" 47 #include "chrome/browser/chromeos/login/signin_specifics.h"
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 1260
1261 UploadDeviceLocalAccountPolicy(); 1261 UploadDeviceLocalAccountPolicy();
1262 AddPublicSessionToDevicePolicy(kAccountId1); 1262 AddPublicSessionToDevicePolicy(kAccountId1);
1263 1263
1264 WaitForPolicy(); 1264 WaitForPolicy();
1265 1265
1266 // Start serving external data at |kExternalDataURL|. 1266 // Start serving external data at |kExternalDataURL|.
1267 scoped_ptr<base::RunLoop> run_loop(new base::RunLoop); 1267 scoped_ptr<base::RunLoop> run_loop(new base::RunLoop);
1268 scoped_ptr<net::FakeURLFetcherFactory> fetcher_factory( 1268 scoped_ptr<net::FakeURLFetcherFactory> fetcher_factory(
1269 new net::FakeURLFetcherFactory( 1269 new net::FakeURLFetcherFactory(
1270 NULL, 1270 NULL, base::Bind(&RunCallbackAndReturnFakeURLFetcher,
1271 base::Bind(&RunCallbackAndReturnFakeURLFetcher, 1271 base::ThreadTaskRunnerHandle::Get(),
1272 base::MessageLoopProxy::current(), 1272 run_loop->QuitClosure())));
1273 run_loop->QuitClosure())));
1274 fetcher_factory->SetFakeResponse(GURL(kExternalDataURL), 1273 fetcher_factory->SetFakeResponse(GURL(kExternalDataURL),
1275 kExternalData, 1274 kExternalData,
1276 net::HTTP_OK, 1275 net::HTTP_OK,
1277 net::URLRequestStatus::SUCCESS); 1276 net::URLRequestStatus::SUCCESS);
1278 1277
1279 // Specify an external data reference for the key::kUserAvatarImage policy. 1278 // Specify an external data reference for the key::kUserAvatarImage policy.
1280 scoped_ptr<base::DictionaryValue> metadata = 1279 scoped_ptr<base::DictionaryValue> metadata =
1281 test::ConstructExternalDataReference(kExternalDataURL, kExternalData); 1280 test::ConstructExternalDataReference(kExternalDataURL, kExternalData);
1282 std::string policy; 1281 std::string policy;
1283 base::JSONWriter::Write(metadata.get(), &policy); 1282 base::JSONWriter::Write(metadata.get(), &policy);
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 ASSERT_TRUE(content::ExecuteScript(contents_, 2333 ASSERT_TRUE(content::ExecuteScript(contents_,
2335 "$('tos-accept-button').click();")); 2334 "$('tos-accept-button').click();"));
2336 2335
2337 WaitForSessionStart(); 2336 WaitForSessionStart();
2338 } 2337 }
2339 2338
2340 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, 2339 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance,
2341 TermsOfServiceDownloadTest, testing::Bool()); 2340 TermsOfServiceDownloadTest, testing::Bool());
2342 2341
2343 } // namespace policy 2342 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698