1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/responsivedesign/test/browser_responsive_cmd.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,107 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function test() { 1.8 + function isOpen() { 1.9 + return !!gBrowser.selectedTab.__responsiveUI; 1.10 + } 1.11 + 1.12 + helpers.addTabWithToolbar("about:blank", function(options) { 1.13 + return helpers.audit(options, [ 1.14 + { 1.15 + setup: "resize toggle", 1.16 + check: { 1.17 + input: 'resize toggle', 1.18 + hints: '', 1.19 + markup: 'VVVVVVVVVVVVV', 1.20 + status: 'VALID' 1.21 + }, 1.22 + exec: { 1.23 + output: "" 1.24 + }, 1.25 + post: function() { 1.26 + ok(isOpen(), "responsive mode is open"); 1.27 + }, 1.28 + }, 1.29 + { 1.30 + setup: "resize toggle", 1.31 + check: { 1.32 + input: 'resize toggle', 1.33 + hints: '', 1.34 + markup: 'VVVVVVVVVVVVV', 1.35 + status: 'VALID' 1.36 + }, 1.37 + exec: { 1.38 + output: "" 1.39 + }, 1.40 + post: function() { 1.41 + ok(!isOpen(), "responsive mode is closed"); 1.42 + }, 1.43 + }, 1.44 + { 1.45 + setup: "resize on", 1.46 + check: { 1.47 + input: 'resize on', 1.48 + hints: '', 1.49 + markup: 'VVVVVVVVV', 1.50 + status: 'VALID' 1.51 + }, 1.52 + exec: { 1.53 + output: "" 1.54 + }, 1.55 + post: function() { 1.56 + ok(isOpen(), "responsive mode is open"); 1.57 + }, 1.58 + }, 1.59 + { 1.60 + setup: "resize off", 1.61 + check: { 1.62 + input: 'resize off', 1.63 + hints: '', 1.64 + markup: 'VVVVVVVVVV', 1.65 + status: 'VALID' 1.66 + }, 1.67 + exec: { 1.68 + output: "" 1.69 + }, 1.70 + post: function() { 1.71 + ok(!isOpen(), "responsive mode is closed"); 1.72 + }, 1.73 + }, 1.74 + { 1.75 + setup: "resize to 400 400", 1.76 + check: { 1.77 + input: 'resize to 400 400', 1.78 + hints: '', 1.79 + markup: 'VVVVVVVVVVVVVVVVV', 1.80 + status: 'VALID', 1.81 + args: { 1.82 + width: { value: 400 }, 1.83 + height: { value: 400 }, 1.84 + } 1.85 + }, 1.86 + exec: { 1.87 + output: "" 1.88 + }, 1.89 + post: function() { 1.90 + ok(isOpen(), "responsive mode is open"); 1.91 + }, 1.92 + }, 1.93 + { 1.94 + setup: "resize off", 1.95 + check: { 1.96 + input: 'resize off', 1.97 + hints: '', 1.98 + markup: 'VVVVVVVVVV', 1.99 + status: 'VALID' 1.100 + }, 1.101 + exec: { 1.102 + output: "" 1.103 + }, 1.104 + post: function() { 1.105 + ok(!isOpen(), "responsive mode is closed"); 1.106 + }, 1.107 + }, 1.108 + ]); 1.109 + }).then(finish); 1.110 +}