| 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 GEN('#include "base/feature_list.h"'); | 5 GEN('#include "base/feature_list.h"'); |
| 6 GEN('#include "chrome/common/chrome_features.h"'); | 6 GEN('#include "chrome/common/chrome_features.h"'); |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Test fixture for print preview WebUI testing. | 9 * Test fixture for print preview WebUI testing. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 380 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + |
| 381 '"extensionName":""}]}'; | 381 '"extensionName":""}]}'; |
| 382 this.setInitialSettings(); | 382 this.setInitialSettings(); |
| 383 | 383 |
| 384 testDone(); | 384 testDone(); |
| 385 }); | 385 }); |
| 386 | 386 |
| 387 //Test with multiple destinations | 387 //Test with multiple destinations |
| 388 TEST_F('PrintPreviewWebUITest', 'TestPrintPreviewRestoreMultipleDestinations', | 388 TEST_F('PrintPreviewWebUITest', 'TestPrintPreviewRestoreMultipleDestinations', |
| 389 function() { | 389 function() { |
| 390 this.initialSettings_.serializedAppStateStr_ = | 390 var origin = cr.isChromeOS ? "chrome_os" : "local"; |
| 391 '{"version":2,"recentDestinations":[{"id":"ID1", "origin":"local",' + | 391 |
| 392 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 392 var appState = { |
| 393 '"extensionName":""},' + | 393 'version': 2, |
| 394 '{"id":"ID2", "origin":"local",' + | 394 'recentDestinations': [ |
| 395 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 395 { |
| 396 '"extensionName":""},' + | 396 'id': 'ID1', |
| 397 '{"id":"ID3", "origin":"local",' + | 397 'origin': origin, |
| 398 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 398 'account': '', |
| 399 '"extensionName":""}]}'; | 399 'capabilities': 0, |
| 400 'name': '', |
| 401 'extensionId': '', |
| 402 'extensionName': '' |
| 403 }, |
| 404 { |
| 405 'id': 'ID2', |
| 406 'origin': origin, |
| 407 'account': '', |
| 408 'capabilities': 0, |
| 409 'name': '', |
| 410 'extensionId': '', |
| 411 'extensionName': '' |
| 412 }, |
| 413 { |
| 414 'id': 'ID3', |
| 415 'origin': origin, |
| 416 'account': '', |
| 417 'capabilities': 0, |
| 418 'name': '', |
| 419 'extensionId': '', |
| 420 'extensionName': '' |
| 421 } |
| 422 ] |
| 423 }; |
| 424 |
| 425 this.initialSettings_.serializedAppStateStr_ = JSON.stringify(appState); |
| 426 |
| 400 this.setInitialSettings(); | 427 this.setInitialSettings(); |
| 401 | 428 |
| 402 // Set capabilities for the three recently used destinations + 1 more | 429 // Set capabilities for the three recently used destinations + 1 more |
| 403 this.setCapabilities(getCddTemplate('ID1')); | 430 this.setCapabilities(getCddTemplate('ID1')); |
| 404 this.setCapabilities(getCddTemplate('ID2')); | 431 this.setCapabilities(getCddTemplate('ID2')); |
| 405 this.setCapabilities(getCddTemplate('ID3')); | 432 this.setCapabilities(getCddTemplate('ID3')); |
| 406 this.setCapabilities(getCddTemplate('ID4')); | 433 this.setCapabilities(getCddTemplate('ID4')); |
| 407 | 434 |
| 408 // The most recently used destination should be the currently selected one. | 435 // The most recently used destination should be the currently selected one. |
| 409 // This is ID1. | 436 // This is ID1. |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 // Check advanced settings is visible and that the search box now | 1254 // Check advanced settings is visible and that the search box now |
| 1228 // appears. | 1255 // appears. |
| 1229 var advancedSettingsCloseButton = $('advanced-settings'). | 1256 var advancedSettingsCloseButton = $('advanced-settings'). |
| 1230 querySelector('.close-button'); | 1257 querySelector('.close-button'); |
| 1231 checkElementDisplayed(advancedSettingsCloseButton, true); | 1258 checkElementDisplayed(advancedSettingsCloseButton, true); |
| 1232 checkElementDisplayed($('advanced-settings'). | 1259 checkElementDisplayed($('advanced-settings'). |
| 1233 querySelector('.search-box-area'), true); | 1260 querySelector('.search-box-area'), true); |
| 1234 | 1261 |
| 1235 this.waitForAnimationToEnd('more-settings'); | 1262 this.waitForAnimationToEnd('more-settings'); |
| 1236 }); | 1263 }); |
| 1237 | |
| OLD | NEW |