Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Dec 9, 2013
2 parents c63c0a6 + 09bba05 commit a656f5e
Show file tree
Hide file tree
Showing 322 changed files with 476 additions and 509 deletions.
2 changes: 1 addition & 1 deletion accessible/src/atk/AccessibleWrap.cpp
Expand Up @@ -25,7 +25,7 @@
#include "States.h"
#include "nsISimpleEnumerator.h"

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"
#include "nsXPCOMStrings.h"
#include "nsComponentManagerUtils.h"
#include "nsIPersistentProperties2.h"
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/base/nsAccessibilityService.cpp
Expand Up @@ -63,9 +63,9 @@
#include "nsTreeUtils.h"
#include "nsXBLPrototypeBinding.h"
#include "nsXBLBinding.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Util.h"
#include "nsDeckFrame.h"

#ifdef MOZ_XUL
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/generic/RootAccessible.cpp
Expand Up @@ -5,7 +5,7 @@

#include "RootAccessible.h"

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"

#define CreateEvent CreateEventA
#include "nsIDOMDocument.h"
Expand Down
2 changes: 1 addition & 1 deletion browser/components/shell/src/nsGNOMEShellService.cpp
Expand Up @@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"

#include "nsCOMPtr.h"
#include "nsGNOMEShellService.h"
Expand Down
2 changes: 1 addition & 1 deletion caps/src/nsNullPrincipal.cpp
Expand Up @@ -9,7 +9,7 @@
* same-origin with anything but themselves.
*/

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"

#include "nsNullPrincipal.h"
#include "nsNullPrincipalURI.h"
Expand Down
2 changes: 1 addition & 1 deletion caps/src/nsScriptSecurityManager.cpp
Expand Up @@ -6,7 +6,7 @@

#include "nsScriptSecurityManager.h"

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"

#include "js/OldDebugAPI.h"
#include "xpcprivate.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/EventSource.cpp
Expand Up @@ -5,9 +5,9 @@

#include "mozilla/dom/EventSource.h"

#include "mozilla/ArrayUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/EventSourceBinding.h"
#include "mozilla/Util.h"

#include "js/OldDebugAPI.h"
#include "nsNetUtil.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/FragmentOrElement.cpp
Expand Up @@ -10,10 +10,10 @@
* utility methods for subclasses, and so forth.
*/

#include "mozilla/ArrayUtils.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Util.h"

#include "mozilla/dom/FragmentOrElement.h"

Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsContentUtils.cpp
Expand Up @@ -28,6 +28,7 @@
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
#include "nsNPAPIPluginInstance.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Attributes.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/Base64.h"
Expand All @@ -45,7 +46,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/TextEvents.h"
#include "mozilla/Util.h"
#include "nsAString.h"
#include "nsAttrName.h"
#include "nsAttrValue.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsDocument.cpp
Expand Up @@ -10,10 +10,10 @@

#include "nsDocument.h"

#include "mozilla/ArrayUtils.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Util.h"
#include "mozilla/Likely.h"
#include <algorithm>

Expand Down
2 changes: 0 additions & 2 deletions content/base/src/nsGkAtoms.cpp
Expand Up @@ -9,8 +9,6 @@
* is loaded and they are destroyed when gklayout is unloaded.
*/

#include "mozilla/Util.h"

#include "nsGkAtoms.h"
#include "nsStaticAtom.h"

Expand Down
1 change: 0 additions & 1 deletion content/base/src/nsINode.cpp
Expand Up @@ -18,7 +18,6 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/MutationEvent.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Util.h"
#include "nsAsyncDOMEvent.h"
#include "nsAttrValueOrString.h"
#include "nsBindingManager.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsNodeInfo.cpp
Expand Up @@ -10,7 +10,7 @@
* prefix, namespace, and localName.
*/

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Likely.h"

#include "nscore.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsTreeSanitizer.cpp
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"

#include "nsTreeSanitizer.h"
#include "nsCSSParser.h"
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsXMLHttpRequest.cpp
Expand Up @@ -6,9 +6,9 @@

#include "nsXMLHttpRequest.h"

#include "mozilla/ArrayUtils.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Util.h"
#include "nsDOMBlobBuilder.h"
#include "nsIDOMDocument.h"
#include "nsIDOMProgressEvent.h"
Expand Down
87 changes: 57 additions & 30 deletions content/canvas/test/webgl/non-conf-tests/driver-info.js
Expand Up @@ -18,9 +18,15 @@ DriverInfo = (function() {
// ---------------------------------------------------------------------------
// OS and driver identification
// Stolen from content/canvas/test/webgl/test_webgl_conformance_test_suite.html
const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;
function detectDriverInfo() {
try {
var cc = SpecialPowers.Cc;
} catch (e) {
throw 'No SpecialPowers!';
}

const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;
var doc = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser).parseFromString("<html/>", "text/html");

var canvas = doc.createElement("canvas");
Expand All @@ -46,6 +52,51 @@ DriverInfo = (function() {
return [webglVendor, webglRenderer];
}

function detectOSInfo() {
try {
var cc = SpecialPowers.Cc;
} catch (e) {
throw 'No SpecialPowers!';
}

const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;

// From reftest.js:
var runtime = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULRuntime);

var os = null;
var version = null;
if (navigator.platform.indexOf('Win') == 0) {
os = OS.WINDOWS;

// code borrowed from browser/modules/test/browser_taskbar_preview.js
version = SpecialPowers.Services.sysinfo.getProperty('version');
version = parseFloat(version);
// Version 6.0 is Vista, 6.1 is 7.

} else if (navigator.platform.indexOf('Mac') == 0) {
os = OS.MAC;

var versionMatch = /Mac OS X (\d+.\d+)/.exec(navigator.userAgent);
version = versionMatch ? parseFloat(versionMatch[1]) : null;

} else if (runtime.widgetToolkit == 'gonk') {
os = OS.B2G;

} else if (navigator.appVersion.indexOf('Android') != -1) {
os = OS.ANDROID;
// From layout/tools/reftest/reftest.js:
version = SpecialPowers.Services.sysinfo.getProperty('version');

} else if (navigator.platform.indexOf('Linux') == 0) {
// Must be checked after android, as android also has a 'Linux' platform string.
os = OS.LINUX;
}

return [os, version];
}

var OS = {
WINDOWS: 'windows',
MAC: 'mac',
Expand All @@ -65,34 +116,10 @@ DriverInfo = (function() {
var kOSVersion = null;
var kDriver = null;

// From reftest.js:
var runtime = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULRuntime);

if (navigator.platform.indexOf('Win') == 0) {
kOS = OS.WINDOWS;

// code borrowed from browser/modules/test/browser_taskbar_preview.js
var version = SpecialPowers.Services.sysinfo.getProperty('version');
kOSVersion = parseFloat(version);
// Version 6.0 is Vista, 6.1 is 7.

} else if (navigator.platform.indexOf('Mac') == 0) {
kOS = OS.MAC;

var versionMatch = /Mac OS X (\d+.\d+)/.exec(navigator.userAgent);
kOSVersion = versionMatch ? parseFloat(versionMatch[1]) : null;

} else if (runtime.widgetToolkit == 'gonk') {
kOS = OS.B2G;

} else if (navigator.appVersion.indexOf('Android') != -1) {
kOS = OS.ANDROID;
// From layout/tools/reftest/reftest.js:
kOSVersion = SpecialPowers.Services.sysinfo.getProperty('version');

} else if (navigator.platform.indexOf('Linux') == 0) {
// Must be checked after android, as android also has a 'Linux' platform string.
kOS = OS.LINUX;
try {
[kOS, kOSVersion] = detectOSInfo();
} catch (e) {
// Generally just fails when we don't have SpecialPowers.
}

try {
Expand Down
86 changes: 86 additions & 0 deletions content/canvas/test/webgl/non-conf-tests/mochi-to-testcase.py
@@ -0,0 +1,86 @@
import sys
import os.path
import re

assert len(sys.argv) == 2
mochiPath = sys.argv[1]

extDotPos = mochiPath.find('.html')
assert extDotPos != -1, 'mochitest target must be an html doc.'

testPath = mochiPath[:extDotPos] + '.solo.html'

def ReadLocalFile(include):
incPath = os.path.dirname(mochiPath)
filePath = os.path.join(incPath, include)

data = None
try:
f = open(filePath, 'r')
data = f.read()
except:
pass

try:
f.close()
except:
pass

return data

kSimpleTestReplacement = '''\n
<script>
// SimpleTest.js replacement
function ok(val, text) {
var elem = document.getElementById('mochi-to-testcase-output');
var status = val ? 'Test <font color=\\'green\\'>passed</font>: '
: 'Test <font color=\\'red\\' >FAILED</font>: ';
elem.innerHTML += '\\n<br/>\\n' + status + text;
}
function todo(val, text) {
ok(!val, 'Todo: ' + text);
}
</script>
<div id='mochi-to-testcase-output'></div>
\n'''

fin = open(mochiPath, 'r')
fout = open(testPath, 'w')
includePattern = re.compile('<script\\s*src=[\'"](.*)\\.js[\'"]>\\s*</script>')
cssPattern = re.compile('<link\\s*rel=[\'"]stylesheet[\'"]\\s*href=[\'"]([^=>]*)[\'"]>')
for line in fin:
skipLine = False
for css in cssPattern.findall(line):
skipLine = True
print('Ignoring stylesheet: ' + css)

for inc in includePattern.findall(line):
skipLine = True
if inc == '/MochiKit/MochiKit':
continue

if inc == '/tests/SimpleTest/SimpleTest':
print('Injecting SimpleTest replacement')
fout.write(kSimpleTestReplacement);
continue

incData = ReadLocalFile(inc + '.js')
if not incData:
print('Warning: Unknown JS file ignored: ' + inc + '.js')
continue

print('Injecting include: ' + inc + '.js')
fout.write('\n<script>\n// Imported from: ' + inc + '.js\n');
fout.write(incData);
fout.write('\n</script>\n');
continue

if skipLine:
continue

fout.write(line)
continue

fin.close()
fout.close()
2 changes: 1 addition & 1 deletion content/events/src/nsDOMDataTransfer.cpp
Expand Up @@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/ArrayUtils.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/Util.h"

#include "nsDOMDataTransfer.h"

Expand Down
2 changes: 1 addition & 1 deletion content/events/src/nsDOMUIEvent.cpp
Expand Up @@ -14,7 +14,7 @@
#include "nsContentUtils.h"
#include "nsEventStateManager.h"
#include "nsIFrame.h"
#include "mozilla/Util.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/ContentEvents.h"
#include "mozilla/TextEvents.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/HTMLBRElement.cpp
Expand Up @@ -5,7 +5,6 @@

#include "mozilla/dom/HTMLBRElement.h"
#include "mozilla/dom/HTMLBRElementBinding.h"
#include "mozilla/Util.h"

#include "nsAttrValueInlines.h"
#include "nsStyleConsts.h"
Expand Down
2 changes: 0 additions & 2 deletions content/html/content/src/HTMLBodyElement.cpp
Expand Up @@ -3,8 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/Util.h"

#include "HTMLBodyElement.h"
#include "mozilla/dom/HTMLBodyElementBinding.h"
#include "nsAttrValueInlines.h"
Expand Down
2 changes: 0 additions & 2 deletions content/html/content/src/HTMLDivElement.cpp
Expand Up @@ -3,8 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/Util.h"

#include "HTMLDivElement.h"
#include "nsGenericHTMLElement.h"
#include "nsStyleConsts.h"
Expand Down

0 comments on commit a656f5e

Please sign in to comment.