mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge fx-team to central, a=merge
CLOSED TREE
This commit is contained in:
commit
9325b0b9ac
@ -11,7 +11,8 @@ module.metadata = {
|
||||
const { Cu } = require("chrome");
|
||||
const { Class } = require("../sdk/core/heritage");
|
||||
const { MessagePort, MessageChannel } = require("../sdk/messaging");
|
||||
const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { require: devtoolsRequire } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const { DebuggerServer } = devtoolsRequire("devtools/server/main");
|
||||
|
||||
const outputs = new WeakMap();
|
||||
const inputs = new WeakMap();
|
||||
|
@ -12,7 +12,8 @@ const { getMostRecentBrowserWindow } = require('sdk/window/utils');
|
||||
const { data } = require('sdk/self');
|
||||
const { set } = require('sdk/preferences/service');
|
||||
|
||||
const { DebuggerServer } = Cu.import('resource://gre/modules/devtools/dbg-server.jsm', {});
|
||||
const { require: devtoolsRequire } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const { DebuggerServer } = devtoolsRequire("devtools/server/main");
|
||||
const { DebuggerClient } = Cu.import('resource://gre/modules/devtools/dbg-client.jsm', {});
|
||||
|
||||
let gClient;
|
||||
|
@ -12,7 +12,8 @@ const { getMostRecentBrowserWindow } = require('sdk/window/utils');
|
||||
const { data } = require('sdk/self');
|
||||
const { set } = require('sdk/preferences/service');
|
||||
|
||||
const { DebuggerServer } = Cu.import('resource://gre/modules/devtools/dbg-server.jsm', {});
|
||||
const { require: devtoolsRequire } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const { DebuggerServer } = devtoolsRequire("devtools/server/main");
|
||||
const { DebuggerClient } = Cu.import('resource://gre/modules/devtools/dbg-client.jsm', {});
|
||||
|
||||
let gClient;
|
||||
|
@ -6,17 +6,17 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "DebuggerServer", function() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
return DebuggerServer;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "devtools", function() {
|
||||
const { devtools } =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
return devtools;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "DebuggerServer", function() {
|
||||
const { DebuggerServer } = devtools.require("devtools/server/main");
|
||||
return DebuggerServer;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "B2GTabList", function() {
|
||||
const { B2GTabList } =
|
||||
devtools.require("resource://gre/modules/DebuggerActors.js");
|
||||
|
@ -286,6 +286,9 @@ let AboutReaderListener = {
|
||||
},
|
||||
|
||||
get isAboutReader() {
|
||||
if (!content) {
|
||||
return false;
|
||||
}
|
||||
return content.document.documentURI.startsWith("about:reader");
|
||||
},
|
||||
|
||||
|
@ -53,8 +53,9 @@
|
||||
</preferences>
|
||||
|
||||
<keyset>
|
||||
<key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1"/>
|
||||
<key key="&focusSearch2.key;" modifiers="accel" id="focusSearch2"/>
|
||||
<!-- These <key>s have oncommand attributes because of bug 371900 -->
|
||||
<key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1" oncommand=";"/>
|
||||
<key key="&focusSearch2.key;" modifiers="accel" id="focusSearch2" oncommand=";"/>
|
||||
</keyset>
|
||||
|
||||
<hbox id="header-application"
|
||||
|
@ -9,6 +9,7 @@ let stateBackup = ss.getBrowserState();
|
||||
function test() {
|
||||
/** Test for Bug 590268 - Provide access to sessionstore tab data sooner **/
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(2);
|
||||
|
||||
let startedTest = false;
|
||||
|
||||
|
@ -25,7 +25,8 @@ Bug 901519 - [app manager] data store for connections
|
||||
<script type="application/javascript;version=1.8" src="chrome://browser/content/devtools/app-manager/template.js"></script>
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
@ -38,8 +39,6 @@ Bug 901519 - [app manager] data store for connections
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {ConnectionManager} = require("devtools/client/connection-manager");
|
||||
const ConnectionStore = require("devtools/app-manager/connection-store");
|
||||
|
||||
|
@ -19,7 +19,8 @@ Bug 901520 - [app manager] data store for device
|
||||
<script type="application/javascript;version=1.8" src="chrome://browser/content/devtools/app-manager/template.js"></script>
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
@ -36,9 +37,6 @@ Bug 901520 - [app manager] data store for device
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {ConnectionManager} = require("devtools/client/connection-manager");
|
||||
const DeviceStore = require("devtools/app-manager/device-store");
|
||||
|
||||
|
@ -18,8 +18,8 @@ Bug 912646 - Closing app toolbox causes phone to disconnect
|
||||
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
@ -31,8 +31,6 @@ Bug 912646 - Closing app toolbox causes phone to disconnect
|
||||
|
||||
Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const {require} =
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {TargetFactory} = require("devtools/framework/target");
|
||||
const {Toolbox} = require("devtools/framework/toolbox");
|
||||
|
||||
|
@ -16,8 +16,9 @@ let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||
let { CanvasFront } = require("devtools/server/actors/canvas");
|
||||
let { setTimeout } = require("sdk/timers");
|
||||
|
@ -18,7 +18,7 @@ let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let { BrowserToolboxProcess } = Cu.import("resource:///modules/devtools/ToolboxProcess.jsm", {});
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { DebuggerClient, ObjectClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
|
||||
|
@ -21,10 +21,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/devtools/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
|
||||
"resource:///modules/CustomizableUI.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
|
||||
"resource://gre/modules/devtools/dbg-server.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
|
||||
"resource://gre/modules/devtools/dbg-client.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
|
||||
const DefaultTools = require("definitions").defaultTools;
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
|
@ -9,8 +9,7 @@ const {Promise: promise} = require("resource://gre/modules/Promise.jsm");
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
|
||||
"resource://gre/modules/devtools/dbg-server.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
|
||||
"resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
//
|
||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Shader Editor is still waiting for a WebGL context to be created.");
|
||||
|
||||
const { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
const { DebuggerClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
|
||||
|
@ -5,8 +5,7 @@
|
||||
* Check regression when opening two tabs
|
||||
*/
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { DebuggerClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
|
||||
|
@ -19,7 +19,7 @@ function toggleAllTools(state) {
|
||||
|
||||
function getChromeActors(callback)
|
||||
{
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -39,7 +39,8 @@ addEventListener("DOMWindowCreated", () => {
|
||||
* @param {String} connPrefix
|
||||
*/
|
||||
function getHighlighterActor(actorID, connPrefix) {
|
||||
let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
let {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
if (!DebuggerServer.initialized) {
|
||||
return;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { TargetFactory } = require("devtools/framework/target");
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { console } = require("resource://gre/modules/devtools/Console.jsm");
|
||||
let { merge } = require("sdk/util/object");
|
||||
let { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
@ -43,7 +43,7 @@ const FALLBACK_CHARSET_LIST = "intl.fallbackCharsetList.ISO-8859-1";
|
||||
|
||||
const VARIABLES_VIEW_URL = "chrome://browser/content/devtools/widgets/VariablesView.xul";
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {require, devtools: loader} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const Telemetry = require("devtools/shared/telemetry");
|
||||
const Editor = require("devtools/sourceeditor/editor");
|
||||
@ -75,8 +75,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "EnvironmentClient",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ObjectClient",
|
||||
"resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
|
||||
"resource://gre/modules/devtools/dbg-server.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
|
||||
"resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
@ -31,13 +31,12 @@ function testThrowOutput()
|
||||
});
|
||||
});
|
||||
|
||||
let server = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {})
|
||||
.DebuggerServer;
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
let longLength = server.LONG_STRING_LENGTH + 1;
|
||||
let longLength = DebuggerServer.LONG_STRING_LENGTH + 1;
|
||||
let longString = new Array(longLength).join("a");
|
||||
let shortedString = longString.substring(0, server.LONG_STRING_INITIAL_LENGTH) +
|
||||
"\u2026";
|
||||
let shortedString = longString.substring(0,
|
||||
DebuggerServer.LONG_STRING_INITIAL_LENGTH) + "\u2026";
|
||||
|
||||
tests.push({
|
||||
method: "display",
|
||||
|
@ -14,9 +14,9 @@ let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { WebGLFront } = require("devtools/server/actors/webgl");
|
||||
let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
let TiltGL = require("devtools/tilt/tilt-gl");
|
||||
|
@ -16,7 +16,7 @@ let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { TargetFactory } = require("devtools/framework/target");
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
||||
let { WebAudioFront } = require("devtools/server/actors/webaudio");
|
||||
|
@ -18,7 +18,7 @@ loader.lazyGetter(this, "WebConsoleFrame", () => require("devtools/webconsole/we
|
||||
loader.lazyImporter(this, "promise", "resource://gre/modules/Promise.jsm", "Promise");
|
||||
loader.lazyImporter(this, "gDevTools", "resource:///modules/devtools/gDevTools.jsm");
|
||||
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
loader.lazyImporter(this, "DebuggerServer", "resource://gre/modules/devtools/dbg-server.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyImporter(this, "DebuggerClient", "resource://gre/modules/devtools/dbg-client.jsm");
|
||||
loader.lazyGetter(this, "showDoorhanger", () => require("devtools/shared/doorhanger").showDoorhanger);
|
||||
loader.lazyRequireGetter(this, "sourceUtils", "devtools/shared/source-utils");
|
||||
|
@ -10,9 +10,7 @@ const TEST_URI = "data:text/html;charset=utf8,test for bug 787981 - check " +
|
||||
"that long strings can be expanded in the output.";
|
||||
|
||||
let test = asyncTest(function* () {
|
||||
let tempScope = {};
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", tempScope);
|
||||
let DebuggerServer = tempScope.DebuggerServer;
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
let longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 4))
|
||||
.join("a") + "foobar";
|
||||
|
@ -15,7 +15,7 @@ thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
||||
|
||||
const TEST_URI = "data:text/html;charset=utf8,test for console output - 01";
|
||||
|
||||
let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
let LONG_STRING_LENGTH = DebuggerServer.LONG_STRING_LENGTH;
|
||||
let LONG_STRING_INITIAL_LENGTH = DebuggerServer.LONG_STRING_INITIAL_LENGTH;
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
const TEST_URI = "data:text/html;charset=utf8,test for console and promises";
|
||||
|
||||
let {DebuggerServer} =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
let LONG_STRING_LENGTH = DebuggerServer.LONG_STRING_LENGTH;
|
||||
let LONG_STRING_INITIAL_LENGTH = DebuggerServer.LONG_STRING_INITIAL_LENGTH;
|
||||
|
@ -6,7 +6,7 @@ const {Cu, Ci} = require("chrome");
|
||||
const {Devices} = Cu.import("resource://gre/modules/devtools/Devices.jsm");
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
|
||||
const {Connection} = require("devtools/client/connection-manager");
|
||||
const {DebuggerServer} = require("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {Simulators} = require("devtools/webide/simulators");
|
||||
const discovery = require("devtools/toolkit/discovery/discovery");
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
|
@ -9,8 +9,7 @@ function test() {
|
||||
requestCompleteLog();
|
||||
|
||||
Task.spawn(function*() {
|
||||
const { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
// Since we test the connections set below, destroy the server in case it
|
||||
// was left open.
|
||||
|
@ -9,8 +9,7 @@ function test() {
|
||||
requestCompleteLog();
|
||||
|
||||
Task.spawn(function*() {
|
||||
const { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
|
@ -28,7 +28,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
let win = yield openWebIDE();
|
||||
let docProject = getProjectDocument(win);
|
||||
@ -61,7 +61,6 @@
|
||||
|
||||
yield closeWebIDE(win);
|
||||
|
||||
const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
DebuggerServer.destroy();
|
||||
|
||||
SimpleTest.finish();
|
||||
|
@ -41,7 +41,7 @@
|
||||
return !win.document.querySelector("#cmd_stop").hasAttribute("disabled");
|
||||
}
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,6 +19,7 @@
|
||||
const { _DeprecatedUSBRuntime, _WiFiRuntime, _SimulatorRuntime,
|
||||
_gRemoteRuntime, _gLocalRuntime, RuntimeTypes }
|
||||
= require("devtools/webide/runtimes");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
// Because we need to gather stats for the period of time that a tool has
|
||||
// been opened we make use of setTimeout() to create tool active times.
|
||||
@ -275,7 +276,6 @@
|
||||
});
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Services.prefs.setBoolPref("devtools.webide.sidebars", true);
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -19,8 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,8 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,7 +19,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
|
@ -29,7 +29,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
win = yield openWebIDE();
|
||||
win.AppManager.update("runtime-list");
|
||||
|
||||
@ -60,7 +60,6 @@
|
||||
|
||||
yield closeWebIDE(win);
|
||||
|
||||
const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
DebuggerServer.destroy();
|
||||
|
||||
SimpleTest.finish();
|
||||
|
@ -40,7 +40,7 @@
|
||||
return !win.document.querySelector("#cmd_stop").hasAttribute("disabled");
|
||||
}
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -19,6 +19,7 @@
|
||||
const { _DeprecatedUSBRuntime, _WiFiRuntime, _SimulatorRuntime,
|
||||
_gRemoteRuntime, _gLocalRuntime, RuntimeTypes }
|
||||
= require("devtools/webide/runtimes");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
// Because we need to gather stats for the period of time that a tool has
|
||||
// been opened we make use of setTimeout() to create tool active times.
|
||||
@ -275,8 +276,6 @@
|
||||
});
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
@ -2639,7 +2639,8 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||
|
||||
#TabsToolbar {
|
||||
-moz-appearance: none;
|
||||
margin-bottom: -1px; /* Overlap the inner highlight at the top of the nav-bar */
|
||||
/* overlap the nav-bar's top border */
|
||||
margin-bottom: calc(-1 * var(--tab-toolbar-navbar-overlap));
|
||||
}
|
||||
|
||||
#main-window:not([customizing]) #navigator-toolbox[inFullscreen] > #TabsToolbar:not(:-moz-lwtheme),
|
||||
|
@ -10,7 +10,7 @@ interface nsIMobileMessageCallback : nsISupports
|
||||
/**
|
||||
* All SMS related errors.
|
||||
* Make sure to keep this list in sync with the list in:
|
||||
* embedding/android/GeckoSmsManager.java
|
||||
* mobile/android/base/GeckoSmsManager.java
|
||||
*/
|
||||
const unsigned short SUCCESS_NO_ERROR = 0;
|
||||
const unsigned short NO_SIGNAL_ERROR = 1;
|
||||
|
@ -1,988 +0,0 @@
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Activity;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.ContentUris;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import android.telephony.SmsManager;
|
||||
import android.telephony.SmsMessage;
|
||||
|
||||
import static android.telephony.SmsMessage.MessageClass;
|
||||
|
||||
/**
|
||||
* This class is returning unique ids for PendingIntent requestCode attribute.
|
||||
* There are only |Integer.MAX_VALUE - Integer.MIN_VALUE| unique IDs available,
|
||||
* and they wrap around.
|
||||
*/
|
||||
class PendingIntentUID
|
||||
{
|
||||
static private int sUID = Integer.MIN_VALUE;
|
||||
|
||||
static public int generate() { return sUID++; }
|
||||
}
|
||||
|
||||
/**
|
||||
* The envelope class contains all information that are needed to keep track of
|
||||
* a sent SMS.
|
||||
*/
|
||||
class Envelope
|
||||
{
|
||||
enum SubParts {
|
||||
SENT_PART,
|
||||
DELIVERED_PART
|
||||
}
|
||||
|
||||
protected int mId;
|
||||
protected int mMessageId;
|
||||
protected long mMessageTimestamp;
|
||||
|
||||
/**
|
||||
* Number of sent/delivered remaining parts.
|
||||
* @note The array has much slots as SubParts items.
|
||||
*/
|
||||
protected int[] mRemainingParts;
|
||||
|
||||
/**
|
||||
* Whether sending/delivering is currently failing.
|
||||
* @note The array has much slots as SubParts items.
|
||||
*/
|
||||
protected boolean[] mFailing;
|
||||
|
||||
/**
|
||||
* Error type (only for sent).
|
||||
*/
|
||||
protected int mError;
|
||||
|
||||
public Envelope(int aId, int aParts) {
|
||||
mId = aId;
|
||||
mMessageId = -1;
|
||||
mMessageTimestamp = 0;
|
||||
mError = GeckoSmsManager.kNoError;
|
||||
|
||||
int size = Envelope.SubParts.values().length;
|
||||
mRemainingParts = new int[size];
|
||||
mFailing = new boolean[size];
|
||||
|
||||
for (int i=0; i<size; ++i) {
|
||||
mRemainingParts[i] = aParts;
|
||||
mFailing[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void decreaseRemainingParts(Envelope.SubParts aType) {
|
||||
--mRemainingParts[aType.ordinal()];
|
||||
|
||||
if (mRemainingParts[SubParts.SENT_PART.ordinal()] >
|
||||
mRemainingParts[SubParts.DELIVERED_PART.ordinal()]) {
|
||||
Log.e("GeckoSmsManager", "Delivered more parts than we sent!?");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean arePartsRemaining(Envelope.SubParts aType) {
|
||||
return mRemainingParts[aType.ordinal()] != 0;
|
||||
}
|
||||
|
||||
public void markAsFailed(Envelope.SubParts aType) {
|
||||
mFailing[aType.ordinal()] = true;
|
||||
}
|
||||
|
||||
public boolean isFailing(Envelope.SubParts aType) {
|
||||
return mFailing[aType.ordinal()];
|
||||
}
|
||||
|
||||
public int getMessageId() {
|
||||
return mMessageId;
|
||||
}
|
||||
|
||||
public void setMessageId(int aMessageId) {
|
||||
mMessageId = aMessageId;
|
||||
}
|
||||
|
||||
public long getMessageTimestamp() {
|
||||
return mMessageTimestamp;
|
||||
}
|
||||
|
||||
public void setMessageTimestamp(long aMessageTimestamp) {
|
||||
mMessageTimestamp = aMessageTimestamp;
|
||||
}
|
||||
|
||||
public int getError() {
|
||||
return mError;
|
||||
}
|
||||
|
||||
public void setError(int aError) {
|
||||
mError = aError;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Postman class is a singleton that manages Envelope instances.
|
||||
*/
|
||||
class Postman
|
||||
{
|
||||
public static final int kUnknownEnvelopeId = -1;
|
||||
|
||||
private static final Postman sInstance = new Postman();
|
||||
|
||||
private ArrayList<Envelope> mEnvelopes = new ArrayList<Envelope>(1);
|
||||
|
||||
private Postman() {}
|
||||
|
||||
public static Postman getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public int createEnvelope(int aParts) {
|
||||
/*
|
||||
* We are going to create the envelope in the first empty slot in the array
|
||||
* list. If there is no empty slot, we create a new one.
|
||||
*/
|
||||
int size = mEnvelopes.size();
|
||||
|
||||
for (int i=0; i<size; ++i) {
|
||||
if (mEnvelopes.get(i) == null) {
|
||||
mEnvelopes.set(i, new Envelope(i, aParts));
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
mEnvelopes.add(new Envelope(size, aParts));
|
||||
return size;
|
||||
}
|
||||
|
||||
public Envelope getEnvelope(int aId) {
|
||||
if (aId < 0 || mEnvelopes.size() <= aId) {
|
||||
Log.e("GeckoSmsManager", "Trying to get an unknown Envelope!");
|
||||
return null;
|
||||
}
|
||||
|
||||
Envelope envelope = mEnvelopes.get(aId);
|
||||
if (envelope == null) {
|
||||
Log.e("GeckoSmsManager", "Trying to get an empty Envelope!");
|
||||
}
|
||||
|
||||
return envelope;
|
||||
}
|
||||
|
||||
public void destroyEnvelope(int aId) {
|
||||
if (aId < 0 || mEnvelopes.size() <= aId) {
|
||||
Log.e("GeckoSmsManager", "Trying to destroy an unknown Envelope!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mEnvelopes.set(aId, null) == null) {
|
||||
Log.e("GeckoSmsManager", "Trying to destroy an empty Envelope!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SmsIOThread extends Thread {
|
||||
private final static SmsIOThread sInstance = new SmsIOThread();
|
||||
|
||||
private Handler mHandler;
|
||||
|
||||
public static SmsIOThread getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public boolean execute(Runnable r) {
|
||||
return mHandler.post(r);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
Looper.prepare();
|
||||
|
||||
mHandler = new Handler();
|
||||
|
||||
Looper.loop();
|
||||
}
|
||||
}
|
||||
|
||||
class MessagesListManager
|
||||
{
|
||||
private static final MessagesListManager sInstance = new MessagesListManager();
|
||||
|
||||
public static MessagesListManager getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private ArrayList<Cursor> mCursors = new ArrayList<Cursor>(0);
|
||||
|
||||
public int add(Cursor aCursor) {
|
||||
int size = mCursors.size();
|
||||
|
||||
for (int i=0; i<size; ++i) {
|
||||
if (mCursors.get(i) == null) {
|
||||
mCursors.set(i, aCursor);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
mCursors.add(aCursor);
|
||||
return size;
|
||||
}
|
||||
|
||||
public Cursor get(int aId) {
|
||||
if (aId < 0 || mCursors.size() <= aId) {
|
||||
Log.e("GeckoSmsManager", "Trying to get an unknown list!");
|
||||
return null;
|
||||
}
|
||||
|
||||
Cursor cursor = mCursors.get(aId);
|
||||
if (cursor == null) {
|
||||
Log.e("GeckoSmsManager", "Trying to get an empty list!");
|
||||
}
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
public void remove(int aId) {
|
||||
if (aId < 0 || mCursors.size() <= aId) {
|
||||
Log.e("GeckoSmsManager", "Trying to destroy an unknown list!");
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor cursor = mCursors.set(aId, null);
|
||||
if (cursor == null) {
|
||||
Log.e("GeckoSmsManager", "Trying to destroy an empty list!");
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
for (int i=0; i<mCursors.size(); ++i) {
|
||||
Cursor c = mCursors.get(i);
|
||||
if (c != null) {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
mCursors.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public class GeckoSmsManager
|
||||
extends BroadcastReceiver
|
||||
implements ISmsManager
|
||||
{
|
||||
public final static String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
|
||||
public final static String ACTION_SMS_SENT = "org.mozilla.gecko.SMS_SENT";
|
||||
public final static String ACTION_SMS_DELIVERED = "org.mozilla.gecko.SMS_DELIVERED";
|
||||
|
||||
/*
|
||||
* Make sure that the following error codes are in sync with the ones
|
||||
* defined in dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl. They are owned
|
||||
* owned by the interface.
|
||||
*/
|
||||
public final static int kNoError = 0;
|
||||
public final static int kNoSignalError = 1;
|
||||
public final static int kNotFoundError = 2;
|
||||
public final static int kUnknownError = 3;
|
||||
public final static int kInternalError = 4;
|
||||
public final static int kNoSimCardError = 5;
|
||||
public final static int kRadioDisabledError = 6;
|
||||
public final static int kInvalidAddressError = 7;
|
||||
public final static int kFdnCheckError = 8;
|
||||
public final static int kNonActiveSimCardError = 9;
|
||||
public final static int kStorageFullError = 10;
|
||||
public final static int kSimNotMatchedError = 11;
|
||||
|
||||
private final static int kMaxMessageSize = 160;
|
||||
|
||||
private final static Uri kSmsContentUri = Uri.parse("content://sms");
|
||||
private final static Uri kSmsSentContentUri = Uri.parse("content://sms/sent");
|
||||
|
||||
private final static int kSmsTypeInbox = 1;
|
||||
private final static int kSmsTypeSentbox = 2;
|
||||
|
||||
/*
|
||||
* Keep the following state codes in syng with |DeliveryState| in:
|
||||
* dom/mobilemessage/Types.h
|
||||
*/
|
||||
private final static int kDeliveryStateSent = 0;
|
||||
private final static int kDeliveryStateReceived = 1;
|
||||
private final static int kDeliveryStateSending = 2;
|
||||
private final static int kDeliveryStateError = 3;
|
||||
private final static int kDeliveryStateUnknown = 4;
|
||||
private final static int kDeliveryStateNotDownloaded = 5;
|
||||
private final static int kDeliveryStateEndGuard = 6;
|
||||
|
||||
/*
|
||||
* Keep the following status codes in sync with |DeliveryStatus| in:
|
||||
* dom/mobilemessage/Types.h
|
||||
*/
|
||||
private final static int kDeliveryStatusNotApplicable = 0;
|
||||
private final static int kDeliveryStatusSuccess = 1;
|
||||
private final static int kDeliveryStatusPending = 2;
|
||||
private final static int kDeliveryStatusError = 3;
|
||||
|
||||
/*
|
||||
* android.provider.Telephony.Sms.STATUS_*. Duplicated because they're not
|
||||
* part of Android public API.
|
||||
*/
|
||||
private final static int kInternalDeliveryStatusNone = -1;
|
||||
private final static int kInternalDeliveryStatusComplete = 0;
|
||||
private final static int kInternalDeliveryStatusPending = 32;
|
||||
private final static int kInternalDeliveryStatusFailed = 64;
|
||||
|
||||
/*
|
||||
* Keep the following values in sync with |MessageClass| in:
|
||||
* dom/mobilemessage/Types.h
|
||||
*/
|
||||
private final static int kMessageClassNormal = 0;
|
||||
private final static int kMessageClassClass0 = 1;
|
||||
private final static int kMessageClassClass1 = 2;
|
||||
private final static int kMessageClassClass2 = 3;
|
||||
private final static int kMessageClassClass3 = 4;
|
||||
|
||||
private final static String[] kRequiredMessageRows = new String[] { "_id", "address", "body", "date", "type", "status" };
|
||||
|
||||
public GeckoSmsManager() {
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
IntentFilter smsFilter = new IntentFilter();
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_RECEIVED);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_SENT);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_DELIVERED);
|
||||
|
||||
GeckoApp.mAppContext.registerReceiver(this, smsFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equals(ACTION_SMS_RECEIVED)) {
|
||||
// TODO: Try to find the receiver number to be able to populate
|
||||
// SmsMessage.receiver.
|
||||
// TODO: Get the id and the date from the stock app saved message.
|
||||
// Using the stock app saved message require us to wait for it to
|
||||
// be saved which can lead to race conditions.
|
||||
|
||||
Bundle bundle = intent.getExtras();
|
||||
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object[] pdus = (Object[]) bundle.get("pdus");
|
||||
|
||||
for (int i=0; i<pdus.length; ++i) {
|
||||
SmsMessage msg = SmsMessage.createFromPdu((byte[])pdus[i]);
|
||||
|
||||
GeckoAppShell.notifySmsReceived(msg.getDisplayOriginatingAddress(),
|
||||
msg.getDisplayMessageBody(),
|
||||
getGeckoMessageClass(msg.getMessageClass()),
|
||||
System.currentTimeMillis());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (intent.getAction().equals(ACTION_SMS_SENT) ||
|
||||
intent.getAction().equals(ACTION_SMS_DELIVERED)) {
|
||||
Bundle bundle = intent.getExtras();
|
||||
|
||||
if (bundle == null || !bundle.containsKey("envelopeId") ||
|
||||
!bundle.containsKey("number") || !bundle.containsKey("message") ||
|
||||
!bundle.containsKey("requestId")) {
|
||||
Log.e("GeckoSmsManager", "Got an invalid ACTION_SMS_SENT/ACTION_SMS_DELIVERED!");
|
||||
return;
|
||||
}
|
||||
|
||||
int envelopeId = bundle.getInt("envelopeId");
|
||||
Postman postman = Postman.getInstance();
|
||||
|
||||
Envelope envelope = postman.getEnvelope(envelopeId);
|
||||
if (envelope == null) {
|
||||
Log.e("GeckoSmsManager", "Got an invalid envelope id (or Envelope has been destroyed)!");
|
||||
return;
|
||||
}
|
||||
|
||||
Envelope.SubParts part = intent.getAction().equals(ACTION_SMS_SENT)
|
||||
? Envelope.SubParts.SENT_PART
|
||||
: Envelope.SubParts.DELIVERED_PART;
|
||||
envelope.decreaseRemainingParts(part);
|
||||
|
||||
|
||||
if (getResultCode() != Activity.RESULT_OK) {
|
||||
switch (getResultCode()) {
|
||||
case SmsManager.RESULT_ERROR_NULL_PDU:
|
||||
envelope.setError(kInternalError);
|
||||
break;
|
||||
case SmsManager.RESULT_ERROR_NO_SERVICE:
|
||||
case SmsManager.RESULT_ERROR_RADIO_OFF:
|
||||
envelope.setError(kNoSignalError);
|
||||
break;
|
||||
case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
|
||||
default:
|
||||
envelope.setError(kUnknownError);
|
||||
break;
|
||||
}
|
||||
envelope.markAsFailed(part);
|
||||
Log.i("GeckoSmsManager", "SMS part sending failed!");
|
||||
}
|
||||
|
||||
if (envelope.arePartsRemaining(part)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (envelope.isFailing(part)) {
|
||||
if (part == Envelope.SubParts.SENT_PART) {
|
||||
GeckoAppShell.notifySmsSendFailed(envelope.getError(),
|
||||
bundle.getInt("requestId"));
|
||||
Log.i("GeckoSmsManager", "SMS sending failed!");
|
||||
} else {
|
||||
GeckoAppShell.notifySmsDelivery(envelope.getMessageId(),
|
||||
kDeliveryStatusError,
|
||||
bundle.getString("number"),
|
||||
bundle.getString("message"),
|
||||
envelope.getMessageTimestamp());
|
||||
Log.i("GeckoSmsManager", "SMS delivery failed!");
|
||||
}
|
||||
} else {
|
||||
if (part == Envelope.SubParts.SENT_PART) {
|
||||
String number = bundle.getString("number");
|
||||
String message = bundle.getString("message");
|
||||
long timestamp = System.currentTimeMillis();
|
||||
|
||||
int id = saveSentMessage(number, message, timestamp);
|
||||
|
||||
GeckoAppShell.notifySmsSent(id, number, message, timestamp,
|
||||
bundle.getInt("requestId"));
|
||||
|
||||
envelope.setMessageId(id);
|
||||
envelope.setMessageTimestamp(timestamp);
|
||||
|
||||
Log.i("GeckoSmsManager", "SMS sending was successfull!");
|
||||
} else {
|
||||
GeckoAppShell.notifySmsDelivery(envelope.getMessageId(),
|
||||
kDeliveryStatusSuccess,
|
||||
bundle.getString("number"),
|
||||
bundle.getString("message"),
|
||||
envelope.getMessageTimestamp());
|
||||
Log.i("GeckoSmsManager", "SMS succesfully delivered!");
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the envelope object only if the SMS has been sent and delivered.
|
||||
if (!envelope.arePartsRemaining(Envelope.SubParts.SENT_PART) &&
|
||||
!envelope.arePartsRemaining(Envelope.SubParts.DELIVERED_PART)) {
|
||||
postman.destroyEnvelope(envelopeId);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void send(String aNumber, String aMessage, int aRequestId) {
|
||||
int envelopeId = Postman.kUnknownEnvelopeId;
|
||||
|
||||
try {
|
||||
SmsManager sm = SmsManager.getDefault();
|
||||
|
||||
Intent sentIntent = new Intent(ACTION_SMS_SENT);
|
||||
Intent deliveredIntent = new Intent(ACTION_SMS_DELIVERED);
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("number", aNumber);
|
||||
bundle.putString("message", aMessage);
|
||||
bundle.putInt("requestId", aRequestId);
|
||||
|
||||
if (aMessage.length() <= kMaxMessageSize) {
|
||||
envelopeId = Postman.getInstance().createEnvelope(1);
|
||||
bundle.putInt("envelopeId", envelopeId);
|
||||
|
||||
sentIntent.putExtras(bundle);
|
||||
deliveredIntent.putExtras(bundle);
|
||||
|
||||
/*
|
||||
* There are a few things to know about getBroadcast and pending intents:
|
||||
* - the pending intents are in a shared pool maintained by the system;
|
||||
* - each pending intent is identified by a token;
|
||||
* - when a new pending intent is created, if it has the same token as
|
||||
* another intent in the pool, one of them has to be removed.
|
||||
*
|
||||
* To prevent having a hard time because of this situation, we give a
|
||||
* unique id to all pending intents we are creating. This unique id is
|
||||
* generated by GetPendingIntentUID().
|
||||
*/
|
||||
PendingIntent sentPendingIntent =
|
||||
PendingIntent.getBroadcast(GeckoApp.mAppContext,
|
||||
PendingIntentUID.generate(), sentIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
PendingIntent deliveredPendingIntent =
|
||||
PendingIntent.getBroadcast(GeckoApp.mAppContext,
|
||||
PendingIntentUID.generate(), deliveredIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
sm.sendTextMessage(aNumber, "", aMessage,
|
||||
sentPendingIntent, deliveredPendingIntent);
|
||||
} else {
|
||||
ArrayList<String> parts = sm.divideMessage(aMessage);
|
||||
envelopeId = Postman.getInstance().createEnvelope(parts.size());
|
||||
bundle.putInt("envelopeId", envelopeId);
|
||||
|
||||
sentIntent.putExtras(bundle);
|
||||
deliveredIntent.putExtras(bundle);
|
||||
|
||||
ArrayList<PendingIntent> sentPendingIntents =
|
||||
new ArrayList<PendingIntent>(parts.size());
|
||||
ArrayList<PendingIntent> deliveredPendingIntents =
|
||||
new ArrayList<PendingIntent>(parts.size());
|
||||
|
||||
for (int i=0; i<parts.size(); ++i) {
|
||||
sentPendingIntents.add(
|
||||
PendingIntent.getBroadcast(GeckoApp.mAppContext,
|
||||
PendingIntentUID.generate(), sentIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT)
|
||||
);
|
||||
|
||||
deliveredPendingIntents.add(
|
||||
PendingIntent.getBroadcast(GeckoApp.mAppContext,
|
||||
PendingIntentUID.generate(), deliveredIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT)
|
||||
);
|
||||
}
|
||||
|
||||
sm.sendMultipartTextMessage(aNumber, "", parts, sentPendingIntents,
|
||||
deliveredPendingIntents);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Failed to send an SMS: ", e);
|
||||
|
||||
if (envelopeId != Postman.kUnknownEnvelopeId) {
|
||||
Postman.getInstance().destroyEnvelope(envelopeId);
|
||||
}
|
||||
|
||||
GeckoAppShell.notifySmsSendFailed(kUnknownError, aRequestId);
|
||||
}
|
||||
}
|
||||
|
||||
public int saveSentMessage(String aRecipient, String aBody, long aDate) {
|
||||
try {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("address", aRecipient);
|
||||
values.put("body", aBody);
|
||||
values.put("date", aDate);
|
||||
// Always 'PENDING' because we always request status report.
|
||||
values.put("status", kInternalDeliveryStatusPending);
|
||||
|
||||
ContentResolver cr = GeckoApp.mAppContext.getContentResolver();
|
||||
Uri uri = cr.insert(kSmsSentContentUri, values);
|
||||
|
||||
long id = ContentUris.parseId(uri);
|
||||
|
||||
// The DOM API takes a 32bits unsigned int for the id. It's unlikely that
|
||||
// we happen to need more than that but it doesn't cost to check.
|
||||
if (id > Integer.MAX_VALUE) {
|
||||
throw new IdTooHighException();
|
||||
}
|
||||
|
||||
return (int)id;
|
||||
} catch (IdTooHighException e) {
|
||||
Log.e("GeckoSmsManager", "The id we received is higher than the higher allowed value.");
|
||||
return -1;
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Something went wrong when trying to write a sent message: " + e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void getMessage(int aMessageId, int aRequestId) {
|
||||
class GetMessageRunnable implements Runnable {
|
||||
private int mMessageId;
|
||||
private int mRequestId;
|
||||
|
||||
GetMessageRunnable(int aMessageId, int aRequestId) {
|
||||
mMessageId = aMessageId;
|
||||
mRequestId = aRequestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Cursor cursor = null;
|
||||
|
||||
try {
|
||||
ContentResolver cr = GeckoApp.mAppContext.getContentResolver();
|
||||
Uri message = ContentUris.withAppendedId(kSmsContentUri, mMessageId);
|
||||
|
||||
cursor = cr.query(message, kRequiredMessageRows, null, null, null);
|
||||
if (cursor == null || cursor.getCount() == 0) {
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
if (cursor.getCount() != 1) {
|
||||
throw new TooManyResultsException();
|
||||
}
|
||||
|
||||
cursor.moveToFirst();
|
||||
|
||||
if (cursor.getInt(cursor.getColumnIndex("_id")) != mMessageId) {
|
||||
throw new UnmatchingIdException();
|
||||
}
|
||||
|
||||
int type = cursor.getInt(cursor.getColumnIndex("type"));
|
||||
int deliveryStatus;
|
||||
String sender = "";
|
||||
String receiver = "";
|
||||
|
||||
if (type == kSmsTypeInbox) {
|
||||
deliveryStatus = kDeliveryStatusSuccess;
|
||||
sender = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else if (type == kSmsTypeSentbox) {
|
||||
deliveryStatus = getGeckoDeliveryStatus(cursor.getInt(cursor.getColumnIndex("status")));
|
||||
receiver = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else {
|
||||
throw new InvalidTypeException();
|
||||
}
|
||||
|
||||
GeckoAppShell.notifyGetSms(cursor.getInt(cursor.getColumnIndex("_id")),
|
||||
deliveryStatus,
|
||||
receiver, sender,
|
||||
cursor.getString(cursor.getColumnIndex("body")),
|
||||
cursor.getLong(cursor.getColumnIndex("date")),
|
||||
mRequestId);
|
||||
} catch (NotFoundException e) {
|
||||
Log.i("GeckoSmsManager", "Message id " + mMessageId + " not found");
|
||||
GeckoAppShell.notifyGetSmsFailed(kNotFoundError, mRequestId);
|
||||
} catch (UnmatchingIdException e) {
|
||||
Log.e("GeckoSmsManager", "Requested message id (" + mMessageId +
|
||||
") is different from the one we got.");
|
||||
GeckoAppShell.notifyGetSmsFailed(kUnknownError, mRequestId);
|
||||
} catch (TooManyResultsException e) {
|
||||
Log.e("GeckoSmsManager", "Get too many results for id " + mMessageId);
|
||||
GeckoAppShell.notifyGetSmsFailed(kUnknownError, mRequestId);
|
||||
} catch (InvalidTypeException e) {
|
||||
Log.i("GeckoSmsManager", "Message has an invalid type, we ignore it.");
|
||||
GeckoAppShell.notifyGetSmsFailed(kNotFoundError, mRequestId);
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Error while trying to get message: " + e);
|
||||
GeckoAppShell.notifyGetSmsFailed(kUnknownError, mRequestId);
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!SmsIOThread.getInstance().execute(new GetMessageRunnable(aMessageId, aRequestId))) {
|
||||
Log.e("GeckoSmsManager", "Failed to add GetMessageRunnable to the SmsIOThread");
|
||||
GeckoAppShell.notifyGetSmsFailed(kUnknownError, aRequestId);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteMessage(int aMessageId, int aRequestId) {
|
||||
class DeleteMessageRunnable implements Runnable {
|
||||
private int mMessageId;
|
||||
private int mRequestId;
|
||||
|
||||
DeleteMessageRunnable(int aMessageId, int aRequestId) {
|
||||
mMessageId = aMessageId;
|
||||
mRequestId = aRequestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ContentResolver cr = GeckoApp.mAppContext.getContentResolver();
|
||||
Uri message = ContentUris.withAppendedId(kSmsContentUri, mMessageId);
|
||||
|
||||
int count = cr.delete(message, null, null);
|
||||
|
||||
if (count > 1) {
|
||||
throw new TooManyResultsException();
|
||||
}
|
||||
|
||||
GeckoAppShell.notifySmsDeleted(count == 1, mRequestId);
|
||||
} catch (TooManyResultsException e) {
|
||||
Log.e("GeckoSmsManager", "Delete more than one message? " + e);
|
||||
GeckoAppShell.notifySmsDeleteFailed(kUnknownError, mRequestId);
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Error while trying to delete a message: " + e);
|
||||
GeckoAppShell.notifySmsDeleteFailed(kUnknownError, mRequestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!SmsIOThread.getInstance().execute(new DeleteMessageRunnable(aMessageId, aRequestId))) {
|
||||
Log.e("GeckoSmsManager", "Failed to add GetMessageRunnable to the SmsIOThread");
|
||||
GeckoAppShell.notifySmsDeleteFailed(kUnknownError, aRequestId);
|
||||
}
|
||||
}
|
||||
|
||||
public void createMessageList(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, int aDeliveryState, boolean aReverse, int aRequestId) {
|
||||
class CreateMessageListRunnable implements Runnable {
|
||||
private long mStartDate;
|
||||
private long mEndDate;
|
||||
private String[] mNumbers;
|
||||
private int mNumbersCount;
|
||||
private int mDeliveryState;
|
||||
private boolean mReverse;
|
||||
private int mRequestId;
|
||||
|
||||
CreateMessageListRunnable(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, int aDeliveryState, boolean aReverse, int aRequestId) {
|
||||
mStartDate = aStartDate;
|
||||
mEndDate = aEndDate;
|
||||
mNumbers = aNumbers;
|
||||
mNumbersCount = aNumbersCount;
|
||||
mDeliveryState = aDeliveryState;
|
||||
mReverse = aReverse;
|
||||
mRequestId = aRequestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Cursor cursor = null;
|
||||
boolean closeCursor = true;
|
||||
|
||||
try {
|
||||
// TODO: should use the |selectionArgs| argument in |ContentResolver.query()|.
|
||||
ArrayList<String> restrictions = new ArrayList<String>();
|
||||
|
||||
if (mStartDate != 0) {
|
||||
restrictions.add("date >= " + mStartDate);
|
||||
}
|
||||
|
||||
if (mEndDate != 0) {
|
||||
restrictions.add("date <= " + mEndDate);
|
||||
}
|
||||
|
||||
if (mNumbersCount > 0) {
|
||||
String numberRestriction = "address IN ('" + mNumbers[0] + "'";
|
||||
|
||||
for (int i=1; i<mNumbersCount; ++i) {
|
||||
numberRestriction += ", '" + mNumbers[i] + "'";
|
||||
}
|
||||
numberRestriction += ")";
|
||||
|
||||
restrictions.add(numberRestriction);
|
||||
}
|
||||
|
||||
if (mDeliveryState == kDeliveryStateUnknown) {
|
||||
restrictions.add("type IN ('" + kSmsTypeSentbox + "', '" + kSmsTypeInbox + "')");
|
||||
} else if (mDeliveryState == kDeliveryStateSent) {
|
||||
restrictions.add("type = " + kSmsTypeSentbox);
|
||||
} else if (mDeliveryState == kDeliveryStateReceived) {
|
||||
restrictions.add("type = " + kSmsTypeInbox);
|
||||
} else {
|
||||
throw new UnexpectedDeliveryStateException();
|
||||
}
|
||||
|
||||
String restrictionText = restrictions.size() > 0 ? restrictions.get(0) : "";
|
||||
|
||||
for (int i=1; i<restrictions.size(); ++i) {
|
||||
restrictionText += " AND " + restrictions.get(i);
|
||||
}
|
||||
|
||||
ContentResolver cr = GeckoApp.mAppContext.getContentResolver();
|
||||
cursor = cr.query(kSmsContentUri, kRequiredMessageRows, restrictionText, null,
|
||||
mReverse ? "date DESC" : "date ASC");
|
||||
|
||||
if (cursor.getCount() == 0) {
|
||||
GeckoAppShell.notifyNoMessageInList(mRequestId);
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.moveToFirst();
|
||||
|
||||
int type = cursor.getInt(cursor.getColumnIndex("type"));
|
||||
int deliveryStatus;
|
||||
String sender = "";
|
||||
String receiver = "";
|
||||
|
||||
if (type == kSmsTypeInbox) {
|
||||
deliveryStatus = kDeliveryStatusSuccess;
|
||||
sender = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else if (type == kSmsTypeSentbox) {
|
||||
deliveryStatus = getGeckoDeliveryStatus(cursor.getInt(cursor.getColumnIndex("status")));
|
||||
receiver = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else {
|
||||
throw new UnexpectedDeliveryStateException();
|
||||
}
|
||||
|
||||
int listId = MessagesListManager.getInstance().add(cursor);
|
||||
closeCursor = false;
|
||||
GeckoAppShell.notifyListCreated(listId,
|
||||
cursor.getInt(cursor.getColumnIndex("_id")),
|
||||
deliveryStatus,
|
||||
receiver, sender,
|
||||
cursor.getString(cursor.getColumnIndex("body")),
|
||||
cursor.getLong(cursor.getColumnIndex("date")),
|
||||
mRequestId);
|
||||
} catch (UnexpectedDeliveryStateException e) {
|
||||
Log.e("GeckoSmsManager", "Unexcepted delivery state type: " + e);
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, mRequestId);
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Error while trying to create a message list cursor: " + e);
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, mRequestId);
|
||||
} finally {
|
||||
// Close the cursor if MessagesListManager isn't taking care of it.
|
||||
// We could also just check if it is in the MessagesListManager list but
|
||||
// that would be less efficient.
|
||||
if (cursor != null && closeCursor) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!SmsIOThread.getInstance().execute(new CreateMessageListRunnable(aStartDate, aEndDate, aNumbers, aNumbersCount, aDeliveryState, aReverse, aRequestId))) {
|
||||
Log.e("GeckoSmsManager", "Failed to add CreateMessageListRunnable to the SmsIOThread");
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
|
||||
}
|
||||
}
|
||||
|
||||
public void getNextMessageInList(int aListId, int aRequestId) {
|
||||
class GetNextMessageInListRunnable implements Runnable {
|
||||
private int mListId;
|
||||
private int mRequestId;
|
||||
|
||||
GetNextMessageInListRunnable(int aListId, int aRequestId) {
|
||||
mListId = aListId;
|
||||
mRequestId = aRequestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Cursor cursor = MessagesListManager.getInstance().get(mListId);
|
||||
|
||||
if (!cursor.moveToNext()) {
|
||||
MessagesListManager.getInstance().remove(mListId);
|
||||
GeckoAppShell.notifyNoMessageInList(mRequestId);
|
||||
return;
|
||||
}
|
||||
|
||||
int type = cursor.getInt(cursor.getColumnIndex("type"));
|
||||
int deliveryStatus;
|
||||
String sender = "";
|
||||
String receiver = "";
|
||||
|
||||
if (type == kSmsTypeInbox) {
|
||||
deliveryStatus = kDeliveryStatusSuccess;
|
||||
sender = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else if (type == kSmsTypeSentbox) {
|
||||
deliveryStatus = getGeckoDeliveryStatus(cursor.getInt(cursor.getColumnIndex("status")));
|
||||
receiver = cursor.getString(cursor.getColumnIndex("address"));
|
||||
} else {
|
||||
throw new UnexpectedDeliveryStateException();
|
||||
}
|
||||
|
||||
int listId = MessagesListManager.getInstance().add(cursor);
|
||||
GeckoAppShell.notifyGotNextMessage(cursor.getInt(cursor.getColumnIndex("_id")),
|
||||
deliveryStatus,
|
||||
receiver, sender,
|
||||
cursor.getString(cursor.getColumnIndex("body")),
|
||||
cursor.getLong(cursor.getColumnIndex("date")),
|
||||
mRequestId);
|
||||
} catch (UnexpectedDeliveryStateException e) {
|
||||
Log.e("GeckoSmsManager", "Unexcepted delivery state type: " + e);
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, mRequestId);
|
||||
} catch (Exception e) {
|
||||
Log.e("GeckoSmsManager", "Error while trying to get the next message of a list: " + e);
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, mRequestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!SmsIOThread.getInstance().execute(new GetNextMessageInListRunnable(aListId, aRequestId))) {
|
||||
Log.e("GeckoSmsManager", "Failed to add GetNextMessageInListRunnable to the SmsIOThread");
|
||||
GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearMessageList(int aListId) {
|
||||
MessagesListManager.getInstance().remove(aListId);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
GeckoApp.mAppContext.unregisterReceiver(this);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
SmsIOThread.getInstance().interrupt();
|
||||
MessagesListManager.getInstance().clear();
|
||||
}
|
||||
|
||||
private int getGeckoDeliveryStatus(int aDeliveryStatus) {
|
||||
if (aDeliveryStatus == kInternalDeliveryStatusNone) {
|
||||
return kDeliveryStatusNotApplicable;
|
||||
}
|
||||
if (aDeliveryStatus >= kInternalDeliveryStatusFailed) {
|
||||
return kDeliveryStatusError;
|
||||
}
|
||||
if (aDeliveryStatus >= kInternalDeliveryStatusPending) {
|
||||
return kDeliveryStatusPending;
|
||||
}
|
||||
return kDeliveryStatusSuccess;
|
||||
}
|
||||
|
||||
private int getGeckoMessageClass(MessageClass aMessageClass) {
|
||||
switch (aMessageClass) {
|
||||
case UNKNOWN:
|
||||
return kMessageClassNormal;
|
||||
case CLASS_0:
|
||||
return kMessageClassClass0;
|
||||
case CLASS_1:
|
||||
return kMessageClassClass1;
|
||||
case CLASS_2:
|
||||
return kMessageClassClass2;
|
||||
case CLASS_3:
|
||||
return kMessageClassClass3;
|
||||
}
|
||||
}
|
||||
|
||||
class IdTooHighException extends Exception {
|
||||
private static final long serialVersionUID = 395697882128640L;
|
||||
}
|
||||
|
||||
class InvalidTypeException extends Exception {
|
||||
private static final long serialVersionUID = 23359904803795434L;
|
||||
}
|
||||
|
||||
class NotFoundException extends Exception {
|
||||
private static final long serialVersionUID = 266226999371957426L;
|
||||
}
|
||||
|
||||
class TooManyResultsException extends Exception {
|
||||
private static final long serialVersionUID = 48899777673841920L;
|
||||
}
|
||||
|
||||
class UnexpectedDeliveryStateException extends Exception {
|
||||
private static final long serialVersionUID = 5044567998961920L;
|
||||
}
|
||||
|
||||
class UnmatchingIdException extends Exception {
|
||||
private static final long serialVersionUID = 1935649715512128L;
|
||||
}
|
||||
}
|
@ -281,7 +281,7 @@ public class GeckoSmsManager
|
||||
|
||||
/*
|
||||
* Make sure that the following error codes are in sync with |ErrorType| in:
|
||||
* dom/mobilemessage/Types.h
|
||||
* dom/mobilemessage/interfaces/nsIMobileMessageCallback.idl
|
||||
* The error code are owned by the DOM.
|
||||
*/
|
||||
public final static int kNoError = 0;
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
|
||||
<!-- Note: After removing all MDPI assets, the reader icons were being resolved
|
||||
incorrectly for MDPI-V11 devices because of the way we use dummy
|
||||
resources to cater for API 9 builds. To fix we renamed the HDPI-V11
|
||||
reader resources and point to them in the HDPI-V11 and MDPI-V11
|
||||
drawable folders. See Bug 1179758 for more info. -->
|
||||
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/ic_menu_reader_add_asset" />
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
|
||||
<!-- Note: After removing all MDPI assets, the reader icons were being resolved
|
||||
incorrectly for MDPI-V11 devices because of the way we use dummy
|
||||
resources to cater for API 9 builds. To fix we renamed the HDPI-V11
|
||||
reader resources and point to them in the HDPI-V11 and MDPI-V11
|
||||
drawable folders. See Bug 1179758 for more info. -->
|
||||
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/ic_menu_reader_remove_asset" />
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
|
||||
<!-- Note: After removing all MDPI assets, the reader icons were being resolved
|
||||
incorrectly for MDPI-V11 devices because of the way we use dummy
|
||||
resources to cater for API 9 builds. To fix we renamed the HDPI-V11
|
||||
reader resources and point to them in the HDPI-V11 and MDPI-V11
|
||||
drawable folders. See Bug 1179758 for more info. -->
|
||||
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/ic_menu_reader_add_asset" />
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
|
||||
<!-- Note: After removing all MDPI assets, the reader icons were being resolved
|
||||
incorrectly for MDPI-V11 devices because of the way we use dummy
|
||||
resources to cater for API 9 builds. To fix we renamed the HDPI-V11
|
||||
reader resources and point to them in the HDPI-V11 and MDPI-V11
|
||||
drawable folders. See Bug 1179758 for more info. -->
|
||||
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/ic_menu_reader_remove_asset" />
|
@ -45,24 +45,24 @@ public class TabsPanel extends LinearLayout
|
||||
IconTabWidget.OnTabChangedListener {
|
||||
private static final String LOGTAG = "Gecko" + TabsPanel.class.getSimpleName();
|
||||
|
||||
public static enum Panel {
|
||||
public enum Panel {
|
||||
NORMAL_TABS,
|
||||
PRIVATE_TABS,
|
||||
}
|
||||
|
||||
public static interface PanelView {
|
||||
public void setTabsPanel(TabsPanel panel);
|
||||
public void show();
|
||||
public void hide();
|
||||
public boolean shouldExpand();
|
||||
public interface PanelView {
|
||||
void setTabsPanel(TabsPanel panel);
|
||||
void show();
|
||||
void hide();
|
||||
boolean shouldExpand();
|
||||
}
|
||||
|
||||
public static interface CloseAllPanelView extends PanelView {
|
||||
public void closeAll();
|
||||
public interface CloseAllPanelView extends PanelView {
|
||||
void closeAll();
|
||||
}
|
||||
|
||||
public static interface TabsLayout extends CloseAllPanelView {
|
||||
public void setEmptyView(View view);
|
||||
public interface TabsLayout extends CloseAllPanelView {
|
||||
void setEmptyView(View view);
|
||||
}
|
||||
|
||||
public static View createTabsLayout(final Context context, final AttributeSet attrs) {
|
||||
@ -73,8 +73,8 @@ public class TabsPanel extends LinearLayout
|
||||
}
|
||||
}
|
||||
|
||||
public static interface TabsLayoutChangeListener {
|
||||
public void onTabsLayoutChange(int width, int height);
|
||||
public interface TabsLayoutChangeListener {
|
||||
void onTabsLayoutChange(int width, int height);
|
||||
}
|
||||
|
||||
private final Context mContext;
|
||||
|
@ -5,8 +5,11 @@
|
||||
/* globals DebuggerServer */
|
||||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
|
||||
"resource://gre/modules/devtools/dbg-server.jsm");
|
||||
XPCOMUtils.defineLazyGetter(this, "DebuggerServer", () => {
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
return DebuggerServer;
|
||||
});
|
||||
|
||||
let RemoteDebugger = {
|
||||
init() {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<h1 class="showNormal">&privatebrowsingpage.title.normal1;</h1>
|
||||
|
||||
<div class="contentSection">
|
||||
<p class="showPrivate">&privatebrowsingpage.description.private3;</p>
|
||||
<p class="showPrivate">&privatebrowsingpage.description.private4;</p>
|
||||
<p class="showNormal">&privatebrowsingpage.description.normal2;</p>
|
||||
|
||||
<p class="showPrivate"><a href="https://support.mozilla.org/kb/private-browsing-firefox-android">&privatebrowsingpage.link.private;</a></p>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<!ENTITY privatebrowsingpage.title.private "+ Tracking Protection">
|
||||
<!ENTITY privatebrowsingpage.title.normal1 "You are not in Private Browsing">
|
||||
|
||||
<!ENTITY privatebrowsingpage.description.private3 "Firefox will prevent you from being tracked and won't remember any history, but downloaded files and new bookmarks will still be saved to your device.">
|
||||
<!ENTITY privatebrowsingpage.description.private4 "&brandShortName; will prevent you from being tracked and won't remember any history, but downloaded files and new bookmarks will still be saved to your device.">
|
||||
<!ENTITY privatebrowsingpage.description.normal2 "In Private Browsing, we won't keep any of your browsing history or cookies. Bookmarks you add and files you download will still be saved on your device.">
|
||||
|
||||
<!ENTITY privatebrowsingpage.link.private "Want to learn more?">
|
||||
|
@ -378,8 +378,9 @@ function _setupDebuggerServer(breakpointFiles, callback) {
|
||||
prefs.setBoolPref("devtools.debugger.log.verbose", true);
|
||||
}
|
||||
|
||||
let {DebuggerServer, OriginalLocation} =
|
||||
Components.utils.import('resource://gre/modules/devtools/dbg-server.jsm', {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { OriginalLocation } = require("devtools/server/actors/common");
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.addBrowserActors();
|
||||
DebuggerServer.addActors("resource://testing-common/dbg-actors.js");
|
||||
|
@ -870,12 +870,6 @@ let Impl = {
|
||||
for (let ioCounter in this._startupIO)
|
||||
ret[ioCounter] = this._startupIO[ioCounter];
|
||||
|
||||
let hasPingBeenSent = false;
|
||||
try {
|
||||
hasPingBeenSent = Telemetry.getHistogramById("TELEMETRY_SUCCESS").snapshot().sum > 0;
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
ret.savedPings = TelemetryStorage.pendingPingCount;
|
||||
|
||||
ret.activeTicks = -1;
|
||||
|
@ -5,9 +5,9 @@ const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
const { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -7,13 +7,13 @@ const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
const CC = Components.Constructor;
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {AppActorFront} = require("devtools/app-actor-front");
|
||||
|
||||
let gClient, gActor, gActorFront;
|
||||
|
@ -10,10 +10,10 @@ const {Cc, Ci, Cu, Cr} = require("chrome");
|
||||
const {setTimeout, clearTimeout} = require('sdk/timers');
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
DevToolsUtils.defineLazyModuleGetter(this, "Task",
|
||||
"resource://gre/modules/Task.jsm");
|
||||
|
||||
|
@ -17,6 +17,7 @@ const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const Services = require("Services");
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
||||
const xpcInspector = require("xpcInspector");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
// We do not want to log packets by default, because in some tests,
|
||||
// we can be sending large amounts of data. The test harness has
|
||||
@ -39,7 +40,6 @@ function tryImport(url) {
|
||||
}
|
||||
}
|
||||
|
||||
tryImport("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
tryImport("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
// Convert an nsIScriptError 'aFlags' value into an appropriate string.
|
||||
|
@ -15,7 +15,7 @@ let chromeGlobal = this;
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
||||
const { dumpn } = DevToolsUtils;
|
||||
const { DebuggerServer, ActorPool } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { DebuggerServer, ActorPool } = require("devtools/server/main");
|
||||
|
||||
// Note that this frame script may be evaluated in non-e10s build
|
||||
// In such case, DebuggerServer is already going to be initialized.
|
||||
|
@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
const {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
const {DebuggerClient} = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
const {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
const PATH = "browser/toolkit/devtools/server/tests/browser/";
|
||||
const MAIN_DOMAIN = "http://test1.example.org/" + PATH;
|
||||
|
@ -1,8 +1,7 @@
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const Services = require("Services");
|
||||
|
||||
// Always log packets when running tests.
|
||||
|
@ -2,7 +2,7 @@ var Cu = Components.utils;
|
||||
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
const Services = require("Services");
|
||||
|
@ -11,10 +11,10 @@ SimpleTest.registerCleanupFunction(function() {
|
||||
});
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
let { MemoryFront } = require("devtools/server/actors/memory");
|
||||
|
||||
|
@ -18,7 +18,8 @@ let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
@ -43,7 +44,8 @@ function runTests() {
|
||||
// Register a test actor in the child process so that we can know if and when
|
||||
// this fake actor is disconnected.
|
||||
mm.loadFrameScript("data:text/javascript,new " + function FrameScriptScope() {
|
||||
const {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
const { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
|
@ -18,8 +18,8 @@ window.onload = function() {
|
||||
|
||||
var Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
|
@ -21,7 +21,7 @@ window.onload = function() {
|
||||
Cu.import("resource://gre/modules/PermissionsTable.jsm");
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -28,7 +28,7 @@ window.onload = function() {
|
||||
|
||||
var { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -28,7 +28,7 @@ window.onload = function() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -28,7 +28,7 @@ window.onload = function() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -28,7 +28,7 @@ window.onload = function() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -17,8 +17,9 @@ let Cu = Components.utils;
|
||||
let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
|
||||
let {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -20,7 +20,7 @@ function runTests() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -20,7 +20,7 @@ window.onload = function() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -21,7 +21,7 @@ function runTests() {
|
||||
|
||||
var {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
var {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
|
@ -18,8 +18,9 @@ let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
var gClient;
|
||||
var gDebuggee;
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
var gClient;
|
||||
var gTabClient;
|
||||
var gDebuggee;
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
function run_test()
|
||||
{
|
||||
// Should get an exception if we try to interact with DebuggerServer
|
||||
|
@ -26,19 +26,8 @@ const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
||||
// Enable remote debugging for the relevant tests.
|
||||
Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
|
||||
|
||||
function tryImport(url) {
|
||||
try {
|
||||
Cu.import(url);
|
||||
} catch (e) {
|
||||
dump("Error importing " + url + "\n");
|
||||
dump(DevToolsUtils.safeErrorString(e) + "\n");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
tryImport("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
tryImport("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
tryImport("resource://gre/modules/devtools/Loader.jsm");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
function testExceptionHook(ex) {
|
||||
try {
|
||||
|
@ -1,14 +1,9 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
let Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
|
@ -1,15 +1,9 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
let Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
let gPort;
|
||||
let gExtraListener;
|
||||
|
||||
|
@ -8,9 +8,6 @@
|
||||
* framed packet, i.e. when the length header is invalid.
|
||||
*/
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
|
||||
const { RawPacket } = require("devtools/toolkit/transport/packets");
|
||||
|
||||
function run_test() {
|
||||
|
@ -1,14 +1,9 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { DebuggerClient } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
let Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
|
||||
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
|
||||
function run_test() {
|
||||
DebuggerServer.registerModule("xpcshell-test/testactors-no-bulk");
|
||||
|
@ -6,8 +6,6 @@
|
||||
* packets are scheduled simultaneously.
|
||||
*/
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
|
||||
|
@ -1,11 +1,8 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let { DebuggerServer } =
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
|
@ -18,6 +18,7 @@ let WebConsoleUtils = require("devtools/toolkit/webconsole/utils").Utils;
|
||||
|
||||
let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
|
||||
.getService(Ci.nsIConsoleAPIStorage);
|
||||
let {DebuggerServer} = require("devtools/server/main");
|
||||
|
||||
let {ConsoleServiceListener, ConsoleAPIListener} =
|
||||
require("devtools/toolkit/webconsole/utils");
|
||||
@ -26,7 +27,6 @@ function initCommon()
|
||||
{
|
||||
//Services.prefs.setBoolPref("devtools.debugger.log", true);
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,8 @@ let Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import('resource://gre/modules/devtools/dbg-server.jsm');
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
this.RemoteDebugger = {
|
||||
init: function(port) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
let { DebuggerServer } = require("devtools/server/main");
|
||||
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
||||
let { RemoteDebugger } = Cu.import("resource://webapprt/modules/RemoteDebugger.jsm", {});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user