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

Unified Diff: chrome/test/data/extensions/platform_apps/window_api/test.js

Issue 166443004: Add frame color option to packaged app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « chrome/renderer/resources/extensions/app_window_custom_bindings.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/platform_apps/window_api/test.js
diff --git a/chrome/test/data/extensions/platform_apps/window_api/test.js b/chrome/test/data/extensions/platform_apps/window_api/test.js
index 42f8a4067e08c41b85e85b7be90b542521e0d296..eb2e86bb9f967e98bafc6d6eda122809b1107e4a 100644
--- a/chrome/test/data/extensions/platform_apps/window_api/test.js
+++ b/chrome/test/data/extensions/platform_apps/window_api/test.js
@@ -3,6 +3,7 @@
// found in the LICENSE file.
var callbackPass = chrome.test.callbackPass;
+var callbackFail = chrome.test.callbackFail;
var defaultFuzzFactor = 1;
function assertFuzzyEq(expected, actual, fuzzFactor, message) {
@@ -559,6 +560,117 @@ function testBadging() {
]);
}
+function testFrameColors() {
+ chrome.test.runTests([
+ function testWithNoColor() {
+ chrome.app.window.create('test.html', callbackPass(function(win) {
+ chrome.test.assertEq(false, win.hasFrameColor);
+ win.close();
+ }));
+ },
+
+ function testWithFrameNone() {
+ chrome.app.window.create('test.html', {
+ frame: 'none'
+ },
+ callbackPass(function(win) {
+ chrome.test.assertEq(false, win.hasFrameColor);
+ win.close();
+ }));
+ },
+
+ function testWithBlack() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ type: 'chrome',
+ color: '#000000'
+ }
+ },
+ callbackPass(function(win) {
+ chrome.test.assertEq(true, win.hasFrameColor);
+ chrome.test.assertEq(-16777216, win.frameColor);
+ win.close();
+ }));
+ },
+
+ function testWithWhite() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ color: '#FFFFFF'
+ }
+ },
+ callbackPass(function(win) {
+ chrome.test.assertEq(true, win.hasFrameColor);
+ chrome.test.assertEq(-1, win.frameColor);
+ win.close();
+ }));
+ },
+
+ function testWithWhiteShorthand() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ color: '#FFF'
+ }
+ },
+ callbackPass(function(win) {
+ chrome.test.assertEq(true, win.hasFrameColor);
+ chrome.test.assertEq(-1, win.frameColor);
+ win.close();
+ }));
+ },
+
+ function testWithFrameAndFrameOptions() {
+ chrome.app.window.create('test.html', {
+ frame: 'chrome',
+ frameOptions: {
+ color: '#FFF'
+ }
+ },
+ callbackFail('Only one of frame and frameOptions can be supplied.'));
+ },
+
+ function testWithFrameNoneAndColor() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ type: 'none',
+ color: '#FFF'
+ }
+ },
+ callbackFail('Windows with no frame cannot have a color.'));
+ },
+
+ function testWithInvalidColor() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ color: 'DontWorryBeHappy'
+ }
+ },
+ callbackFail('The color specification could not be parsed.'));
+ }
+ ]);
+}
+
+function testFrameColorsInStable() {
+ chrome.test.runTests([
+ function testWithNoColor() {
+ chrome.app.window.create('test.html', callbackPass(function(win) {
+ chrome.test.assertEq(true, win.hasFrameColor);
+ chrome.test.assertEq(-1, win.frameColor);
+ win.close();
+ }));
+ },
+
+ function testWithOptionsGivesError() {
+ chrome.app.window.create('test.html', {
+ frameOptions: {
+ color: '#FFF'
+ }
+ },
+ callbackFail('frameOptions is only available in dev channel.'));
+ }
+ ]);
+}
+
chrome.app.runtime.onLaunched.addListener(function() {
chrome.test.sendMessage('Launched', function(reply) {
window[reply]();
« no previous file with comments | « chrome/renderer/resources/extensions/app_window_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698