OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 function optionsPageLoaded() { | 5 function optionsPageLoaded() { |
6 var hasLoaded = false; | 6 var hasLoaded = false; |
7 chrome.extension.getViews().forEach(function(view) { | 7 chrome.extension.getViews().forEach(function(view) { |
8 if (view.document.location.pathname == '/options.html') { | 8 if (view.document.location.pathname == '/options.html') { |
9 chrome.test.assertEq(false, hasLoaded); | 9 chrome.test.assertEq(false, hasLoaded); |
10 hasLoaded = view.loaded; | 10 hasLoaded = view.loaded; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 if (onStorageChanged && onSetAndGet) { | 104 if (onStorageChanged && onSetAndGet) { |
105 document.body.removeChild(extensionoptions); | 105 document.body.removeChild(extensionoptions); |
106 done(); | 106 done(); |
107 } | 107 } |
108 }); | 108 }); |
109 | 109 |
110 var extensionoptions = document.createElement('extensionoptions'); | 110 var extensionoptions = document.createElement('extensionoptions'); |
111 extensionoptions.setAttribute('extension', chrome.runtime.id); | 111 extensionoptions.setAttribute('extension', chrome.runtime.id); |
112 document.body.appendChild(extensionoptions); | 112 document.body.appendChild(extensionoptions); |
| 113 }, |
| 114 |
| 115 function autosizedGuestIsWithinSizeConstraints() { |
| 116 var done = chrome.test.callbackAdded(); |
| 117 |
| 118 var extensionoptions = new ExtensionOptions(); |
| 119 extensionoptions.extension = chrome.runtime.id; |
| 120 extensionoptions.autosize = 'on'; |
| 121 extensionoptions.minheight = 499; |
| 122 extensionoptions.minwidth = 499; |
| 123 extensionoptions.maxheight = 501; |
| 124 extensionoptions.maxwidth = 501; |
| 125 |
| 126 extensionoptions.onsizechanged = function(evt) { |
| 127 try { |
| 128 chrome.test.assertTrue(evt.width >= 499); |
| 129 chrome.test.assertTrue(evt.height >= 499); |
| 130 chrome.test.assertTrue(evt.width <= 501); |
| 131 chrome.test.assertTrue(evt.height <= 501); |
| 132 done(); |
| 133 } finally { |
| 134 document.body.removeChild(extensionoptions); |
| 135 } |
| 136 }; |
| 137 |
| 138 document.body.appendChild(extensionoptions); |
113 } | 139 } |
114 ]); | 140 ]); |
OLD | NEW |