Bug 709585 - Part 3/6, Plug mozPower into navigator object. r=sicking

--HG--
extra : rebase_source : ec26dca3f0adf92da1940a42e80b6dc4398bf12b
This commit is contained in:
Kan-Ru Chen 2012-01-30 17:02:46 -06:00
Родитель 0497e08340
Коммит 3cd1fe7746
7 изменённых файлов: 57 добавлений и 20 удалений

Просмотреть файл

@ -162,6 +162,7 @@
@BINPATH@/components/dom_indexeddb.xpt
@BINPATH@/components/dom_offline.xpt
@BINPATH@/components/dom_json.xpt
@BINPATH@/components/dom_power.xpt
@BINPATH@/components/dom_range.xpt
@BINPATH@/components/dom_sidebar.xpt
@BINPATH@/components/dom_sms.xpt

Просмотреть файл

@ -939,6 +939,14 @@ Navigator::GetMozBattery(nsIDOMMozBatteryManager** aBattery)
return NS_OK;
}
NS_IMETHODIMP
Navigator::GetMozPower(nsIDOMMozPowerManager** aPower)
{
*aPower = nsnull;
return NS_OK;
}
//*****************************************************************************
// Navigator::nsIDOMNavigatorSms
//*****************************************************************************

Просмотреть файл

@ -129,3 +129,6 @@ interface nsIDOMPkcs11;
// Used font face (for inspector)
interface nsIDOMFontFace;
interface nsIDOMFontFaceList;
// Power
interface nsIDOMMozPowerManager;

Просмотреть файл

@ -39,26 +39,27 @@
#include "domstubs.idl"
[scriptable, uuid(a1ee08c1-0299-4908-a6ba-7cBc8da6531f)]
[scriptable, uuid(b1f4b1fa-49c2-4375-9ce8-bf97ecf6b428)]
interface nsIDOMNavigator : nsISupports
{
readonly attribute DOMString appCodeName;
readonly attribute DOMString appName;
readonly attribute DOMString appVersion;
readonly attribute DOMString language;
readonly attribute nsIDOMMimeTypeArray mimeTypes;
readonly attribute DOMString platform;
readonly attribute DOMString oscpu;
readonly attribute DOMString vendor;
readonly attribute DOMString vendorSub;
readonly attribute DOMString product;
readonly attribute DOMString productSub;
readonly attribute nsIDOMPluginArray plugins;
readonly attribute DOMString userAgent;
readonly attribute boolean cookieEnabled;
readonly attribute boolean onLine;
readonly attribute DOMString buildID;
readonly attribute DOMString doNotTrack;
readonly attribute DOMString appCodeName;
readonly attribute DOMString appName;
readonly attribute DOMString appVersion;
readonly attribute DOMString language;
readonly attribute nsIDOMMimeTypeArray mimeTypes;
readonly attribute DOMString platform;
readonly attribute DOMString oscpu;
readonly attribute DOMString vendor;
readonly attribute DOMString vendorSub;
readonly attribute DOMString product;
readonly attribute DOMString productSub;
readonly attribute nsIDOMPluginArray plugins;
readonly attribute DOMString userAgent;
readonly attribute boolean cookieEnabled;
readonly attribute boolean onLine;
readonly attribute DOMString buildID;
readonly attribute DOMString doNotTrack;
readonly attribute nsIDOMMozPowerManager mozPower;
boolean javaEnabled();

Просмотреть файл

@ -49,10 +49,11 @@ DIRS = \
include $(topsrcdir)/config/rules.mk
_TEST_FILES = \
test_power_basics.html \
$(NULL)
#libs:: $(_TEST_FILES)
# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
#libs:: $(_CHROME_TEST_FILES)
# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

Просмотреть файл

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Power API</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Power API **/
ok('mozPower' in navigator, "navigator.mozPower should exist");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -93,6 +93,7 @@ SHARED_LIBRARY_LIBS = \
$(DEPTH)/view/src/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/base/$(LIB_PREFIX)jsdombase_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/battery/$(LIB_PREFIX)dom_battery_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/power/$(LIB_PREFIX)dom_power_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/network/src/$(LIB_PREFIX)dom_network_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/sms/src/$(LIB_PREFIX)dom_sms_s.$(LIB_SUFFIX) \
$(DEPTH)/dom/src/events/$(LIB_PREFIX)jsdomevents_s.$(LIB_SUFFIX) \