| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('print_preview_test', function() { | 5 cr.define('print_preview_test', function() { |
| 6 /** | 6 /** |
| 7 * Index of the "Save as PDF" printer. | 7 * Index of the "Save as PDF" printer. |
| 8 * @type {number} | 8 * @type {number} |
| 9 * @const | 9 * @const |
| 10 */ | 10 */ |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 localDestinationInfos = [ | 296 localDestinationInfos = [ |
| 297 { printerName: 'FooName', deviceName: 'FooDevice' }, | 297 { printerName: 'FooName', deviceName: 'FooDevice' }, |
| 298 { printerName: 'BarName', deviceName: 'BarDevice' }, | 298 { printerName: 'BarName', deviceName: 'BarDevice' }, |
| 299 ]; | 299 ]; |
| 300 | 300 |
| 301 nativeLayer = new print_preview.NativeLayerStub(); | 301 nativeLayer = new print_preview.NativeLayerStub(); |
| 302 print_preview.NativeLayer.setInstance(nativeLayer); | 302 print_preview.NativeLayer.setInstance(nativeLayer); |
| 303 printPreview = new print_preview.PrintPreview(); | 303 printPreview = new print_preview.PrintPreview(); |
| 304 previewArea = printPreview.getPreviewArea(); | 304 previewArea = printPreview.getPreviewArea(); |
| 305 previewArea.setIsBrowserTest(true); | 305 previewArea.plugin_ = |
| 306 new print_preview.PDFPluginStub(previewArea); |
| 307 previewArea.plugin_.setLoadCallback( |
| 308 previewArea.onPluginLoad_.bind(previewArea)); |
| 306 }); | 309 }); |
| 307 | 310 |
| 308 // Test some basic assumptions about the print preview WebUI. | 311 // Test some basic assumptions about the print preview WebUI. |
| 309 test('PrinterList', function() { | 312 test('PrinterList', function() { |
| 310 return setupSettingsAndDestinationsWithCapabilities().then(function() { | 313 return setupSettingsAndDestinationsWithCapabilities().then(function() { |
| 311 var recentList = | 314 var recentList = |
| 312 $('destination-search').querySelector('.recent-list ul'); | 315 $('destination-search').querySelector('.recent-list ul'); |
| 313 var localList = | 316 var localList = |
| 314 $('destination-search').querySelector('.local-list ul'); | 317 $('destination-search').querySelector('.local-list ul'); |
| 315 assertNotEquals(null, recentList); | 318 assertNotEquals(null, recentList); |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 return setupSettingsAndDestinationsWithCapabilities().then(function() { | 1418 return setupSettingsAndDestinationsWithCapabilities().then(function() { |
| 1416 // The system default destination should be used instead of the | 1419 // The system default destination should be used instead of the |
| 1417 // most recent destination. | 1420 // most recent destination. |
| 1418 assertEquals( | 1421 assertEquals( |
| 1419 'FooDevice', | 1422 'FooDevice', |
| 1420 printPreview.destinationStore_.selectedDestination.id); | 1423 printPreview.destinationStore_.selectedDestination.id); |
| 1421 }); | 1424 }); |
| 1422 }); | 1425 }); |
| 1423 }); | 1426 }); |
| 1424 }); | 1427 }); |
| OLD | NEW |