michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Test that screenshot command works properly michael@0: const TEST_URI = "http://example.com/browser/browser/devtools/commandline/" + michael@0: "test/browser_cmd_media.html"; michael@0: let tests = { michael@0: testInput: function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: "media emulate braille", michael@0: check: { michael@0: input: "media emulate braille", michael@0: markup: "VVVVVVVVVVVVVVVVVVVVV", michael@0: status: "VALID", michael@0: args: { michael@0: type: { value: "braille"}, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "media reset", michael@0: check: { michael@0: input: "media reset", michael@0: markup: "VVVVVVVVVVV", michael@0: status: "VALID", michael@0: args: { michael@0: } michael@0: }, michael@0: }, michael@0: ]); michael@0: }, michael@0: michael@0: testEmulateMedia: function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: "media emulate braille", michael@0: check: { michael@0: args: { michael@0: type: { value: "braille"} michael@0: } michael@0: }, michael@0: exec: { michael@0: output: "" michael@0: }, michael@0: post: function() { michael@0: let body = options.window.document.body; michael@0: let style = options.window.getComputedStyle(body); michael@0: is(style.backgroundColor, "rgb(255, 255, 0)", "media correctly emulated"); michael@0: } michael@0: } michael@0: ]); michael@0: }, michael@0: michael@0: testEndMediaEmulation: function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: function() { michael@0: let mDV = options.browser.markupDocumentViewer; michael@0: mDV.emulateMedium("embossed"); michael@0: return helpers.setInput(options, "media reset"); michael@0: }, michael@0: exec: { michael@0: output: "" michael@0: }, michael@0: post: function() { michael@0: let body = options.window.document.body; michael@0: let style = options.window.getComputedStyle(body); michael@0: is(style.backgroundColor, "rgb(255, 255, 255)", "media reset"); michael@0: } michael@0: } michael@0: ]); michael@0: } michael@0: }; michael@0: michael@0: function test() { michael@0: return Task.spawn(function() { michael@0: let options = yield helpers.openTab(TEST_URI); michael@0: yield helpers.openToolbar(options); michael@0: michael@0: yield helpers.runTests(options, tests); michael@0: michael@0: yield helpers.closeToolbar(options); michael@0: yield helpers.closeTab(options); michael@0: }).then(finish, helpers.handleError); michael@0: }