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

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

Issue 9403010: Add support for kiosk mode on the client. Make sure the settings are written in the lockbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made registration fail on missing enrollment type. Created 8 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 arg3->response_data = response_data.SerializeAsString(); 57 arg3->response_data = response_data.SerializeAsString();
58 arg3->response_code = http_error_code; 58 arg3->response_code = http_error_code;
59 } 59 }
60 60
61 // An action that returns an URLRequestJob with a successful device 61 // An action that returns an URLRequestJob with a successful device
62 // registration response. 62 // registration response.
63 ACTION_P(CreateSuccessfulRegisterResponse, token) { 63 ACTION_P(CreateSuccessfulRegisterResponse, token) {
64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
65 em::DeviceManagementResponse response_data; 65 em::DeviceManagementResponse response_data;
66 response_data.mutable_register_response()->set_device_management_token(token); 66 response_data.mutable_register_response()->set_device_management_token(token);
67 response_data.mutable_register_response()->set_enrollment_type(
68 em::DeviceRegisterResponse::ENTERPRISE);
67 69
68 arg3->response_data = response_data.SerializeAsString(); 70 arg3->response_data = response_data.SerializeAsString();
69 arg3->response_code = 200; 71 arg3->response_code = 200;
70 } 72 }
71 73
72 // An action that returns an URLRequestJob with a successful policy response. 74 // An action that returns an URLRequestJob with a successful policy response.
73 ACTION_P3(CreateSuccessfulPolicyResponse, 75 ACTION_P3(CreateSuccessfulPolicyResponse,
74 homepage_location, 76 homepage_location,
75 set_serial_valid, 77 set_serial_valid,
76 serial_valid) { 78 serial_valid) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { 453 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) {
452 InSequence s; 454 InSequence s;
453 ExpectSuccessfulRegistration(); 455 ExpectSuccessfulRegistration();
454 ExpectPolicyRequest("", true, true); 456 ExpectPolicyRequest("", true, true);
455 ExpectPolicyRequest(kMachineId, false, false); 457 ExpectPolicyRequest(kMachineId, false, false);
456 ExpectPolicyRequest("", false, false); 458 ExpectPolicyRequest("", false, false);
457 ExecuteTest(); 459 ExecuteTest();
458 } 460 }
459 461
460 } // policy 462 } // policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698