Bug 1275160 - Web Manifest: Don't special case orientation. r=mconley
authorMarcos Caceres <marcos@marcosc.com>
Wed, 25 May 2016 18:35:00 -0400
changeset 338194 1b8749c914b047f44fe3447c62c4472f244c6a8e
parent 338193 b87905133eafb182539e8ea332ad19ab9548e8ee
child 338195 94033f5e655567162a397af1f48a3bf00e884421
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1275160
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1275160 - Web Manifest: Don't special case orientation. r=mconley
dom/manifest/ManifestProcessor.jsm
dom/manifest/test/test_ManifestProcessor_orientation.html
--- a/dom/manifest/ManifestProcessor.jsm
+++ b/dom/manifest/ManifestProcessor.jsm
@@ -144,18 +144,17 @@ this.ManifestProcessor = { // jshint ign
         property: 'orientation',
         expectedType: 'string',
         trim: true
       };
       const value = extractor.extractValue(spec);
       if (value && typeof value === "string" && this.orientationTypes.has(value.toLowerCase())) {
         return value.toLowerCase();
       }
-      // The spec special-cases orientation to return the empty string.
-      return '';
+      return undefined;
     }
 
     function processDisplayMember() {
       const spec = {
         objectName: 'manifest',
         object: rawManifest,
         property: 'display',
         expectedType: 'string',
--- a/dom/manifest/test/test_ManifestProcessor_orientation.html
+++ b/dom/manifest/test/test_ManifestProcessor_orientation.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 'use strict';
 
 typeTests.forEach((type) => {
   var expected = `Expect non-string orientation to be empty string : ${typeof type}.`;
   data.jsonText = JSON.stringify({
     orientation: type
   });
   var result = processor.process(data);
-  is(result.orientation, '', expected);
+  is(result.orientation, undefined, expected);
 });
 
 var validOrientations = [
   'any',
   'natural',
   'landscape',
   'portrait',
   'portrait-primary',
@@ -64,17 +64,17 @@ var invalidOrientations = [
   'landscape-landscape',
   'secondary-primary'
 ];
 
 invalidOrientations.forEach((orientation) => {
   var expected = `Expect orientation to be empty string: ${orientation}.`;
   data.jsonText = JSON.stringify({ orientation });
   var result = processor.process(data);
-  is(result.orientation, "", expected);
+  is(result.orientation, undefined, expected);
 });
 
 //Trim tests
 validOrientations.forEach((orientation) => {
   var expected = `Expect trimmed orientation to be returned.`;
   var expandedOrientation = `${seperators}${lineTerminators}${orientation}${lineTerminators}${seperators}`;
   data.jsonText = JSON.stringify({
     orientation: expandedOrientation