Index: chrome/test/data/webui/print_preview/print_preview_tests.js |
diff --git a/chrome/test/data/webui/print_preview/print_preview_tests.js b/chrome/test/data/webui/print_preview/print_preview_tests.js |
index 33ddef39b060097a8a8edc667aa041f549d58213..0da7f027f0dd99407b98fd53755a478bd1e33a6d 100644 |
--- a/chrome/test/data/webui/print_preview/print_preview_tests.js |
+++ b/chrome/test/data/webui/print_preview/print_preview_tests.js |
@@ -1337,5 +1337,41 @@ cr.define('print_preview_test', function() { |
expectTrue(nativeLayer.generateDraft()); |
}); |
}); |
+ |
+ // Test that the policy to use the system default printer by default |
+ // instead of the most recently used destination works. |
+ test('SystemDefaultPrinterPolicy', function() { |
+ // Add recent destination. |
+ initialSettings.serializedAppStateStr_ = JSON.stringify({ |
+ version: 2, |
+ recentDestinations: [ |
+ { |
+ id: 'ID1', |
+ origin: cr.isChromeOS ? 'chrome_os' : 'local', |
+ account: '', |
+ capabilities: 0, |
+ name: 'One', |
+ extensionId: '', |
+ extensionName: '', |
+ }, |
+ ], |
+ }); |
+ |
+ // Setup local destinations with the system default + recent. |
+ localDestinationInfos = [ |
+ { printerName: 'One', deviceName: 'ID1' }, |
+ { printerName: 'FooName', deviceName: 'FooDevice' } |
+ ]; |
+ nativeLayer.setLocalDestinationCapabilities( |
+ getCddTemplate('ID1', 'One')); |
+ |
+ return setupSettingsAndDestinationsWithCapabilities().then(function() { |
+ // The system default destination should be used instead of the |
+ // most recent destination. |
+ assertEquals( |
+ 'FooDevice', |
+ printPreview.destinationStore_.selectedDestination.id); |
+ }); |
+ }); |
}); |
}); |