Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: chrome/test/data/webui/print_preview/print_preview_tests.js

Issue 2885363003: Add policy to use system default printer (Closed)
Patch Set: Remove IOS checks Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fa0892ea985f0734e0f610538972ba2f36eded0f 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: '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);
+ });
+ });
});
});
« no previous file with comments | « chrome/test/data/policy/policy_test_cases.json ('k') | chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698