| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 382 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + |
| 383 '"extensionName":""}]}'; | 383 '"extensionName":""}]}'; |
| 384 this.setInitialSettings(); | 384 this.setInitialSettings(); |
| 385 | 385 |
| 386 testDone(); | 386 testDone(); |
| 387 }); | 387 }); |
| 388 | 388 |
| 389 //Test with multiple destinations | 389 //Test with multiple destinations |
| 390 TEST_F('PrintPreviewWebUITest', 'TestPrintPreviewRestoreMultipleDestinations', | 390 TEST_F('PrintPreviewWebUITest', 'TestPrintPreviewRestoreMultipleDestinations', |
| 391 function() { | 391 function() { |
| 392 this.initialSettings_.serializedAppStateStr_ = | 392 var origin = cr.isChromeOS ? "chrome_os" : "local"; |
| 393 '{"version":2,"recentDestinations":[{"id":"ID1", "origin":"local",' + | 393 |
| 394 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 394 var appState = { |
| 395 '"extensionName":""},' + | 395 'version': 2, |
| 396 '{"id":"ID2", "origin":"local",' + | 396 'recentDestinations': [ |
| 397 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 397 { |
| 398 '"extensionName":""},' + | 398 'id': 'ID1', |
| 399 '{"id":"ID3", "origin":"local",' + | 399 'origin': origin, |
| 400 '"account":"", "capabilities":0, "name":"", "extensionId":"",' + | 400 'account': '', |
| 401 '"extensionName":""}]}'; | 401 'capabilities': 0, |
| 402 'name': '', |
| 403 'extensionId': '', |
| 404 'extensionName': '' |
| 405 }, |
| 406 { |
| 407 'id': 'ID2', |
| 408 'origin': origin, |
| 409 'account': '', |
| 410 'capabilities': 0, |
| 411 'name': '', |
| 412 'extensionId': '', |
| 413 'extensionName': '' |
| 414 }, |
| 415 { |
| 416 'id': 'ID3', |
| 417 'origin': origin, |
| 418 'account': '', |
| 419 'capabilities': 0, |
| 420 'name': '', |
| 421 'extensionId': '', |
| 422 'extensionName': '' |
| 423 } |
| 424 ] |
| 425 }; |
| 426 |
| 427 this.initialSettings_.serializedAppStateStr_ = JSON.stringify(appState); |
| 428 |
| 402 this.setInitialSettings(); | 429 this.setInitialSettings(); |
| 403 | 430 |
| 404 // Set capabilities for the three recently used destinations + 1 more | 431 // Set capabilities for the three recently used destinations + 1 more |
| 405 this.setCapabilities(getCddTemplate('ID1')); | 432 this.setCapabilities(getCddTemplate('ID1')); |
| 406 this.setCapabilities(getCddTemplate('ID2')); | 433 this.setCapabilities(getCddTemplate('ID2')); |
| 407 this.setCapabilities(getCddTemplate('ID3')); | 434 this.setCapabilities(getCddTemplate('ID3')); |
| 408 this.setCapabilities(getCddTemplate('ID4')); | 435 this.setCapabilities(getCddTemplate('ID4')); |
| 409 | 436 |
| 410 // The most recently used destination should be the currently selected one. | 437 // The most recently used destination should be the currently selected one. |
| 411 // This is ID1. | 438 // This is ID1. |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 // Check advanced settings is visible and that the search box now | 1272 // Check advanced settings is visible and that the search box now |
| 1246 // appears. | 1273 // appears. |
| 1247 var advancedSettingsCloseButton = $('advanced-settings'). | 1274 var advancedSettingsCloseButton = $('advanced-settings'). |
| 1248 querySelector('.close-button'); | 1275 querySelector('.close-button'); |
| 1249 checkElementDisplayed(advancedSettingsCloseButton, true); | 1276 checkElementDisplayed(advancedSettingsCloseButton, true); |
| 1250 checkElementDisplayed($('advanced-settings'). | 1277 checkElementDisplayed($('advanced-settings'). |
| 1251 querySelector('.search-box-area'), true); | 1278 querySelector('.search-box-area'), true); |
| 1252 | 1279 |
| 1253 this.waitForAnimationToEnd('more-settings'); | 1280 this.waitForAnimationToEnd('more-settings'); |
| 1254 }); | 1281 }); |
| 1255 | |
| OLD | NEW |