| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // None of these tests is relevant for Chrome OS. | 5 // None of these tests is relevant for Chrome OS. |
| 6 GEN('#if !defined(OS_CHROMEOS)'); | 6 GEN('#if !defined(OS_CHROMEOS)'); |
| 7 | 7 |
| 8 GEN('#include "base/command_line.h"'); | |
| 9 GEN('#include "chrome/common/chrome_switches.h"'); | |
| 10 | |
| 11 /** | 8 /** |
| 12 * TestFixture for ManageProfileOverlay and CreateProfileOverlay WebUI testing. | 9 * TestFixture for ManageProfileOverlay and CreateProfileOverlay WebUI testing. |
| 13 * @extends {testing.Test} | 10 * @extends {testing.Test} |
| 14 * @constructor | 11 * @constructor |
| 15 */ | 12 */ |
| 16 function ManageProfileUITest() {} | 13 function ManageProfileUITest() {} |
| 17 | 14 |
| 18 ManageProfileUITest.prototype = { | 15 ManageProfileUITest.prototype = { |
| 19 __proto__: testing.Test.prototype, | 16 __proto__: testing.Test.prototype, |
| 20 | 17 |
| 21 /** @override */ | 18 /** @override */ |
| 22 browsePreload: 'chrome://settings-frame/manageProfile', | 19 browsePreload: 'chrome://settings-frame/manageProfile', |
| 23 | 20 |
| 24 /** | 21 /** |
| 25 * No need to run these for every OptionsPage test, since they'll cover the | 22 * No need to run these for every OptionsPage test, since they'll cover the |
| 26 * whole consolidated page each time. | 23 * whole consolidated page each time. |
| 27 * @override | 24 * @override |
| 28 */ | 25 */ |
| 29 runAccessibilityChecks: false, | 26 runAccessibilityChecks: false, |
| 30 | 27 |
| 31 /** @override */ | |
| 32 testGenPreamble: function() { | |
| 33 GEN('CommandLine::ForCurrentProcess()->' + | |
| 34 'AppendSwitch(switches::kAllowCreateExistingManagedUsers);'); | |
| 35 }, | |
| 36 | |
| 37 /** | 28 /** |
| 38 * Returns a test profile-info object with configurable "managed" status. | 29 * Returns a test profile-info object with configurable "managed" status. |
| 39 * @param {boolean} managed If true, the test profile will be marked as | 30 * @param {boolean} managed If true, the test profile will be marked as |
| 40 * managed. | 31 * managed. |
| 41 * @return {Object} A test profile-info object. | 32 * @return {Object} A test profile-info object. |
| 42 */ | 33 */ |
| 43 testProfileInfo_: function(managed) { | 34 testProfileInfo_: function(managed) { |
| 44 return { | 35 return { |
| 45 name: 'Test Profile', | 36 name: 'Test Profile', |
| 46 iconURL: 'chrome://path/to/icon/image', | 37 iconURL: 'chrome://path/to/icon/image', |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); | 511 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); |
| 521 | 512 |
| 522 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); | 513 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); |
| 523 this.setProfileManaged_(true, 'manage'); | 514 this.setProfileManaged_(true, 'manage'); |
| 524 messages = clickAndListen(); | 515 messages = clickAndListen(); |
| 525 assertEquals(0, messages.length); | 516 assertEquals(0, messages.length); |
| 526 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); | 517 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); |
| 527 }); | 518 }); |
| 528 | 519 |
| 529 GEN('#endif // OS_CHROMEOS'); | 520 GEN('#endif // OS_CHROMEOS'); |
| OLD | NEW |