import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
16
mobile/android/tests/browser/chrome/basic_article.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
49
mobile/android/tests/browser/chrome/chrome.ini
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
[DEFAULT]
|
||||
skip-if = os != 'android'
|
||||
support-files =
|
||||
basic_article.html
|
||||
basic_article_mobile.html
|
||||
desktopmode_user_agent.sjs
|
||||
devicesearch.xml
|
||||
head.js
|
||||
head_search.js
|
||||
session_formdata_sample.html
|
||||
simpleservice.xml
|
||||
video_controls.html
|
||||
video_discovery.html
|
||||
video_discovery.sjs
|
||||
web_channel.html
|
||||
tp5/**
|
||||
|
||||
[test_about_logins.html]
|
||||
[test_accounts.html]
|
||||
[test_android_log.html]
|
||||
[test_app_constants.html]
|
||||
[test_awsy_lite.html]
|
||||
# historically, we only run awsy on opt; gc times out on debug
|
||||
skip-if = debug
|
||||
[test_debugger_server.html]
|
||||
[test_desktop_useragent.html]
|
||||
[test_device_search_engine.html]
|
||||
[test_get_last_visited.html]
|
||||
[test_home_provider.html]
|
||||
[test_hidden_select_option.html]
|
||||
[test_identity_mode.html]
|
||||
[test_java_addons.html]
|
||||
[test_jni.html]
|
||||
[test_migrate_ui.html]
|
||||
[test_network_manager.html]
|
||||
[test_offline_page.html]
|
||||
skip-if = true # Bug 1241478
|
||||
[test_reader_view.html]
|
||||
[test_resource_substitutions.html]
|
||||
[test_restricted_profiles.html]
|
||||
[test_select_disabled.html]
|
||||
[test_selectoraddtab.html]
|
||||
[test_session_form_data.html]
|
||||
[test_session_scroll_position.html]
|
||||
[test_session_zombification.html]
|
||||
[test_shared_preferences.html]
|
||||
[test_simple_discovery.html]
|
||||
[test_video_discovery.html]
|
||||
[test_web_channel.html]
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
function handleRequest(request, response)
|
||||
{
|
||||
// avoid confusing cache behaviors
|
||||
response.setHeader("Cache-Control", "no-cache", false);
|
||||
response.setHeader("Content-Type", "text/plain", false);
|
||||
response.setHeader("Access-Control-Allow-Origin", "*", false);
|
||||
|
||||
// used by mobile/desktop user agent tests
|
||||
response.write(request.getHeader("User-Agent"));
|
||||
}
|
||||
|
||||
17
mobile/android/tests/browser/chrome/devicesearch.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>Test search engine</ShortName>
|
||||
<Description>A test search engine (based on Google search)</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image>
|
||||
<Url type="text/html" method="GET" template="http://example.com/search">
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<Url type="application/x-moz-tabletsearch" method="GET" template="http://example.com/search/tablet">
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<Url type="application/x-moz-phonesearch" method="GET" template="http://example.com/search/phone">
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<SearchForm>http://example.com/</SearchForm>
|
||||
</SearchPlugin>
|
||||
72
mobile/android/tests/browser/chrome/head.js
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function fuzzyEquals(a, b) {
|
||||
return (Math.abs(a - b) < 1e-6);
|
||||
}
|
||||
|
||||
function promiseBrowserEvent(browser, eventType) {
|
||||
return new Promise((resolve) => {
|
||||
function handle(event) {
|
||||
// Since we'll be redirecting, don't make assumptions about the given URL and the loaded URL
|
||||
if (event.target != browser.contentDocument || event.target.location.href == "about:blank") {
|
||||
info("Skipping spurious '" + eventType + "' event" + " for " + event.target.location.href);
|
||||
return;
|
||||
}
|
||||
info("Received event " + eventType + " from browser");
|
||||
browser.removeEventListener(eventType, handle, true);
|
||||
resolve(event);
|
||||
}
|
||||
|
||||
browser.addEventListener(eventType, handle, true);
|
||||
info("Now waiting for " + eventType + " event from browser");
|
||||
});
|
||||
}
|
||||
|
||||
function promiseTabEvent(container, eventType) {
|
||||
return new Promise((resolve) => {
|
||||
function handle(event) {
|
||||
info("Received event " + eventType + " from container");
|
||||
container.removeEventListener(eventType, handle, true);
|
||||
resolve(event);
|
||||
}
|
||||
|
||||
container.addEventListener(eventType, handle, true);
|
||||
info("Now waiting for " + eventType + " event from container");
|
||||
});
|
||||
}
|
||||
|
||||
function promiseNotification(topic) {
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
function observe(subject, topic, data) {
|
||||
info("Received " + topic + " notification from Gecko");
|
||||
Services.obs.removeObserver(observe, topic);
|
||||
resolve();
|
||||
}
|
||||
Services.obs.addObserver(observe, topic, false);
|
||||
info("Now waiting for " + topic + " notification from Gecko");
|
||||
});
|
||||
}
|
||||
|
||||
function promiseLinkVisit(url) {
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var topic = "link-visited";
|
||||
return new Promise((resolve, reject) => {
|
||||
function observe(subject, topic, data) {
|
||||
info("Received " + topic + " notification from Gecko");
|
||||
var uri = subject.QueryInterface(Ci.nsIURI);
|
||||
if (uri.spec != url) {
|
||||
info("Visited URL " + uri.spec + " is not desired URL " + url + "; ignoring.");
|
||||
return;
|
||||
}
|
||||
info("Visited URL " + uri.spec + " is desired URL " + url);
|
||||
Services.obs.removeObserver(observe, topic);
|
||||
resolve();
|
||||
};
|
||||
Services.obs.addObserver(observe, topic, false);
|
||||
info("Now waiting for " + topic + " notification from Gecko with URL " + url);
|
||||
});
|
||||
}
|
||||
46
mobile/android/tests/browser/chrome/head_search.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Bits and pieces copied from toolkit/components/search/tests/xpcshell/head_search.js
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
/**
|
||||
* Adds test engines and returns a promise resolved when they are installed.
|
||||
*
|
||||
* The engines are added in the given order.
|
||||
*
|
||||
* @param aItems
|
||||
* Array of objects with the following properties:
|
||||
* {
|
||||
* name: Engine name, used to wait for it to be loaded.
|
||||
* details: Array containing the parameters of addEngineWithDetails,
|
||||
* except for the engine name. Alternative to xmlFileName.
|
||||
* }
|
||||
*/
|
||||
var addTestEngines = Task.async(function* (aItems) {
|
||||
let engines = [];
|
||||
|
||||
for (let item of aItems) {
|
||||
yield new Promise((resolve, reject) => {
|
||||
Services.obs.addObserver(function obs(subject, topic, data) {
|
||||
try {
|
||||
let engine = subject.QueryInterface(Ci.nsISearchEngine);
|
||||
if (data != "engine-added" || engine.name != item.name) {
|
||||
return;
|
||||
}
|
||||
|
||||
Services.obs.removeObserver(obs, "browser-search-engine-modified");
|
||||
engines.push(engine);
|
||||
resolve();
|
||||
} catch (ex) {
|
||||
reject(ex);
|
||||
}
|
||||
}, "browser-search-engine-modified", false);
|
||||
|
||||
Services.search.addEngineWithDetails(item.name, ...item.details);
|
||||
});
|
||||
}
|
||||
|
||||
return engines;
|
||||
});
|
||||
16
mobile/android/tests/browser/chrome/memory_page_1.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
16
mobile/android/tests/browser/chrome/memory_page_2.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
16
mobile/android/tests/browser/chrome/memory_page_3.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
16
mobile/android/tests/browser/chrome/memory_page_4.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article title</title>
|
||||
<meta name="description" content="This is the article description." />
|
||||
</head>
|
||||
<body>
|
||||
<header>Site header</header>
|
||||
<div>
|
||||
<h1>Article title</h1>
|
||||
<h2 class="author">by Jane Doe</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
|
||||
<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>session_formdata_sample.html</title>
|
||||
</head>
|
||||
<body>
|
||||
<input id="txt" />
|
||||
|
||||
<script type="text/javascript;version=1.8">
|
||||
let isOuter = window == window.top;
|
||||
|
||||
if (isOuter) {
|
||||
let iframe = document.createElement("iframe");
|
||||
iframe.setAttribute("src", "https://example.com" + location.pathname);
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
15
mobile/android/tests/browser/chrome/simpleservice.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
<root xmlns="urn:schemas-upnp-org:device-1-0">
|
||||
<specVersion>
|
||||
<major>1</major>
|
||||
<minor>0</minor>
|
||||
</specVersion>
|
||||
<URLBase>http://example.com</URLBase>
|
||||
<device>
|
||||
<deviceType>urn:dial-multiscreen-org:device:dial:1</deviceType>
|
||||
<friendlyName>Pretend Device</friendlyName>
|
||||
<manufacturer>Copy Cat Inc.</manufacturer>
|
||||
<modelName>Eureka Dongle</modelName>
|
||||
<UDN>uuid:5ec9ff92-e8b2-4a94-a72c-76b34e6dabb1</UDN>
|
||||
</device>
|
||||
</root>
|
||||
106
mobile/android/tests/browser/chrome/test_about_logins.html
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1136477
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1136477</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.8" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const LOGIN_FIELDS = {
|
||||
hostname: "http://example.org/tests/robocop/robocop_blank_01.html",
|
||||
formSubmitUrl: "",
|
||||
realmAny: null,
|
||||
username: "username1",
|
||||
password: "password1",
|
||||
usernameField: "",
|
||||
passwordField: ""
|
||||
};
|
||||
|
||||
const LoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1", "nsILoginInfo", "init");
|
||||
|
||||
function add_login(login) {
|
||||
let newLogin = new LoginInfo(login.hostname,
|
||||
login.formSubmitUrl,
|
||||
login.realmAny,
|
||||
login.username,
|
||||
login.password,
|
||||
login.usernameField,
|
||||
login.passwordField);
|
||||
|
||||
Services.logins.addLogin(newLogin);
|
||||
}
|
||||
|
||||
add_task(function* test_passwords_list() {
|
||||
add_login(LOGIN_FIELDS);
|
||||
|
||||
// Load about:logins.
|
||||
let BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
|
||||
let browser = BrowserApp.addTab("about:logins", { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
let logins_list_parent = browser.contentDocument.getElementById("logins-list").parentNode;
|
||||
|
||||
let waitForLoginToBeAdded = new Promise((resolve) => {
|
||||
let observer = new MutationObserver((mutations) => {
|
||||
for (let mutation of mutations) {
|
||||
for (let node of mutation.addedNodes) {
|
||||
if (node.id == 'logins-list') {
|
||||
info("Received mutation replacing 'logins-list'");
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
info("Skipping spurious mutation not replacing 'logins-list'");
|
||||
});
|
||||
observer.observe(logins_list_parent, {
|
||||
childList: true,
|
||||
});
|
||||
info("Now waiting for mutation to replace 'logins-list'");
|
||||
});
|
||||
|
||||
yield waitForLoginToBeAdded;
|
||||
|
||||
let logins_list = browser.contentDocument.getElementById("logins-list");
|
||||
|
||||
// Test that the (single) entry added in setup is correct.
|
||||
let hostname = logins_list.querySelector(".hostname");
|
||||
is(hostname.textContent, LOGIN_FIELDS.hostname, "hostname is correct");
|
||||
|
||||
let username = logins_list.querySelector(".username");
|
||||
is(username.textContent, LOGIN_FIELDS.username, "username is correct");
|
||||
|
||||
// Cleanup: close about:logins, opened in password_setup()
|
||||
BrowserApp.closeTab(BrowserApp.selectedTab);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1136477">Mozilla Bug 1136477</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testAboutLogins</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
48
mobile/android/tests/browser/chrome/test_accounts.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=917942
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 917942</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
Components.utils.import("resource://gre/modules/Accounts.jsm");
|
||||
|
||||
add_task(function* () {
|
||||
let syncExists = yield Accounts.syncAccountsExist();
|
||||
info("Sync account exists? " + syncExists + "\n");
|
||||
let firefoxExists = yield Accounts.firefoxAccountsExist();
|
||||
info("Firefox account exists? " + firefoxExists + "\n");
|
||||
let anyExists = yield Accounts.anySyncAccountsExist();
|
||||
info("Any accounts exist? " + anyExists + "\n");
|
||||
|
||||
// Only one account should exist.
|
||||
ok(!syncExists || !firefoxExists, "at least one account does not exist");
|
||||
is(anyExists, firefoxExists || syncExists, "sync/firefox account existence consistent with any existence");
|
||||
|
||||
// TODO: How can this be cleaned up?
|
||||
//info("Launching setup.\n");
|
||||
//Accounts.launchSetup();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=917942">Mozilla Bug 917942</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testAccounts</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
95
mobile/android/tests/browser/chrome/test_android_log.html
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1004825
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1004825</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
/*globals AndroidLog */
|
||||
|
||||
const TAG = "AndroidLogTest";
|
||||
|
||||
const VERBOSE_MESSAGE = "This is a verbose message.";
|
||||
const DEBUG_MESSAGE = "This is a debug message.";
|
||||
const INFO_MESSAGE = "This is an info message.";
|
||||
const WARNING_MESSAGE = "This is a warning message.";
|
||||
const ERROR_MESSAGE = "This is an error message.";
|
||||
|
||||
// Number of bytes we expect to log. This isn't equivalent to the number
|
||||
// of characters, although the difference is consistent, so we can calculate it
|
||||
// from the lengths of the messages and tag. We include the length of "Gecko"
|
||||
// because the module prepends it to the tag.
|
||||
const VERBOSE_BYTES = "Gecko".length + TAG.length + VERBOSE_MESSAGE.length + 3;
|
||||
const DEBUG_BYTES = "Gecko".length + TAG.length + DEBUG_MESSAGE.length + 3;
|
||||
const INFO_BYTES = "Gecko".length + TAG.length + INFO_MESSAGE.length + 3;
|
||||
const WARNING_BYTES = "Gecko".length + TAG.length + WARNING_MESSAGE.length + 3;
|
||||
const ERROR_BYTES = "Gecko".length + TAG.length + ERROR_MESSAGE.length + 3;
|
||||
|
||||
Components.utils.import("resource://gre/modules/AndroidLog.jsm");
|
||||
|
||||
ok(!!AndroidLog, "AndroidLog is defined");
|
||||
|
||||
ok("v" in AndroidLog && typeof AndroidLog.v == "function", "v function found");
|
||||
ok("d" in AndroidLog && typeof AndroidLog.d == "function", "d function found");
|
||||
ok("i" in AndroidLog && typeof AndroidLog.i == "function", "i function found");
|
||||
ok("w" in AndroidLog && typeof AndroidLog.w == "function", "w function found");
|
||||
ok("e" in AndroidLog && typeof AndroidLog.e == "function", "e function found");
|
||||
|
||||
// Ensure that the functions don't cause the test process to crash
|
||||
// (because of some change to the native object being accessed via ctypes)
|
||||
// and return the right values (the number of bytes logged).
|
||||
// XXX Ensure that these messages actually make it to the log (bug 1046096).
|
||||
is(VERBOSE_BYTES, AndroidLog.v(TAG, VERBOSE_MESSAGE), "verbose bytes correct");
|
||||
is(DEBUG_BYTES, AndroidLog.d(TAG, DEBUG_MESSAGE), "debug bytes correct");
|
||||
is(INFO_BYTES, AndroidLog.i(TAG, INFO_MESSAGE), "info bytes correct");
|
||||
is(WARNING_BYTES, AndroidLog.w(TAG, WARNING_MESSAGE), "warning bytes correct");
|
||||
is(ERROR_BYTES, AndroidLog.e(TAG, ERROR_MESSAGE), "error bytes correct");
|
||||
|
||||
// Ensure the functions work when bound with null value for thisArg parameter.
|
||||
is(VERBOSE_BYTES, AndroidLog.v.bind(null, TAG)(VERBOSE_MESSAGE), "verbose bytes correct with bind");
|
||||
is(DEBUG_BYTES, AndroidLog.d.bind(null, TAG)(DEBUG_MESSAGE), "debug bytes correct with bind");
|
||||
is(INFO_BYTES, AndroidLog.i.bind(null, TAG)(INFO_MESSAGE), "info bytes correct with bind");
|
||||
is(WARNING_BYTES, AndroidLog.w.bind(null, TAG)(WARNING_MESSAGE), "warning bytes correct with bind");
|
||||
is(ERROR_BYTES, AndroidLog.e.bind(null, TAG)(ERROR_MESSAGE), "error bytes correct with bind");
|
||||
|
||||
// Ensure the functions work when the module object is "bound" to a tag.
|
||||
let Log = AndroidLog.bind(TAG);
|
||||
is(VERBOSE_BYTES, Log.v(VERBOSE_MESSAGE), "verbose bytes correct after bind");
|
||||
is(DEBUG_BYTES, Log.d(DEBUG_MESSAGE), "debug bytes correct after bind");
|
||||
is(INFO_BYTES, Log.i(INFO_MESSAGE), "info bytes correct after bind");
|
||||
is(WARNING_BYTES, Log.w(WARNING_MESSAGE), "warning bytes correct after bind");
|
||||
is(ERROR_BYTES, Log.e(ERROR_MESSAGE), "error bytes correct after bind");
|
||||
|
||||
// Ensure the functions work when the tag length is greater than the maximum
|
||||
// tag length.
|
||||
let tag = "X".repeat(AndroidLog.MAX_TAG_LENGTH + 1);
|
||||
is(AndroidLog.MAX_TAG_LENGTH + 54, AndroidLog.v(tag, "This is a verbose message with a too-long tag."), "verbose message with too-long tag");
|
||||
is(AndroidLog.MAX_TAG_LENGTH + 52, AndroidLog.d(tag, "This is a debug message with a too-long tag."), "debug message with too-long tag");
|
||||
is(AndroidLog.MAX_TAG_LENGTH + 52, AndroidLog.i(tag, "This is an info message with a too-long tag."), "info message with too-long tag");
|
||||
is(AndroidLog.MAX_TAG_LENGTH + 54, AndroidLog.w(tag, "This is a warning message with a too-long tag."), "warning message with too-long tag");
|
||||
is(AndroidLog.MAX_TAG_LENGTH + 53, AndroidLog.e(tag, "This is an error message with a too-long tag."), "error message with too-long tag");
|
||||
|
||||
// We should also ensure that the module is accessible from a ChromeWorker,
|
||||
// but there doesn't seem to be a way to load a ChromeWorker from this test.
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1004825">Mozilla Bug 1004825</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testAndroidLog</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
35
mobile/android/tests/browser/chrome/test_app_constants.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1130872
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1130872</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
Components.utils.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
var packageName = AppConstants.ANDROID_PACKAGE_NAME;
|
||||
|
||||
ok(packageName != "@ANDROID_PACKAGE_NAME@", "package name is not placeholder");
|
||||
ok(packageName.length > 0, "package name is not empty");
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1130872">Mozilla Bug 1130872</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testAppConstants</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
258
mobile/android/tests/browser/chrome/test_awsy_lite.html
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
This test reports Firefox memory use to Perfherder.
|
||||
|
||||
Inspired by https://areweslimyet.com/mobile
|
||||
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1233220
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1233220</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/MemoryStats.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.8" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.8">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
|
||||
|
||||
var kUrls = [
|
||||
"http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/tp5/baidu.com/www.baidu.com/s@wd=mozilla.html",
|
||||
"http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/tp5/twitter.com/twitter.com/ICHCheezburger.html",
|
||||
"http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/tp5/msn.com/www.msn.com/index.html",
|
||||
"http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/tp5/163.com/www.163.com/index.html",
|
||||
"http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/tp5/bbc.co.uk/www.bbc.co.uk/news/index.html"
|
||||
];
|
||||
|
||||
var gTabsOpened = 0;
|
||||
var gWindow = null;
|
||||
var gLastTab = null;
|
||||
var gResults = [];
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.requestLongerTimeout(3); // several long waits and GCs make for a long-running test
|
||||
SimpleTest.requestCompleteLog(); // so that "PERFHERDER_DATA" can be scraped from the log
|
||||
|
||||
function checkpoint(aName) {
|
||||
var mrm = Cc["@mozilla.org/memory-reporter-manager;1"].getService(Ci.nsIMemoryReporterManager);
|
||||
gResults.push( { name: aName, resident: mrm.resident } );
|
||||
info(`${aName} | Resident Memory: ${mrm.resident}`);
|
||||
}
|
||||
|
||||
var browserListener = {
|
||||
onOpenWindow: function(aWindow) {
|
||||
var win = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
|
||||
win.addEventListener("UIReady", function listener(aEvent) {
|
||||
win.removeEventListener("UIReady", listener, false);
|
||||
attachTo(win);
|
||||
}, false);
|
||||
},
|
||||
|
||||
onCloseWindow: function(aWindow) {
|
||||
detachFrom(aWindow);
|
||||
},
|
||||
|
||||
onWindowTitleChange: function(aWindow, aTitle) {
|
||||
}
|
||||
};
|
||||
|
||||
function doFullGc(aCallback, aIterations) {
|
||||
var threadMan = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
|
||||
var domWindowUtils = gWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
|
||||
function runSoon(f) {
|
||||
threadMan.mainThread.dispatch({ run: f }, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
function cc() {
|
||||
if (domWindowUtils.cycleCollect) {
|
||||
domWindowUtils.cycleCollect();
|
||||
}
|
||||
Services.obs.notifyObservers(null, "child-cc-request", null);
|
||||
}
|
||||
|
||||
function minimizeInner() {
|
||||
// In order of preference: schedulePreciseShrinkingGC, schedulePreciseGC
|
||||
// garbageCollect
|
||||
if (++j <= aIterations) {
|
||||
var schedGC = Cu.schedulePreciseShrinkingGC;
|
||||
if (!schedGC) {
|
||||
schedGC = Cu.schedulePreciseGC;
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "child-gc-request", null);
|
||||
|
||||
if (schedGC) {
|
||||
schedGC.call(Cu, { callback: function () {
|
||||
runSoon(function () { cc(); runSoon(minimizeInner); });
|
||||
} });
|
||||
} else {
|
||||
if (domWindowUtils.garbageCollect) {
|
||||
domWindowUtils.garbageCollect();
|
||||
}
|
||||
runSoon(function () { cc(); runSoon(minimizeInner); });
|
||||
}
|
||||
} else {
|
||||
runSoon(aCallback);
|
||||
}
|
||||
}
|
||||
|
||||
var j = 0;
|
||||
minimizeInner();
|
||||
}
|
||||
|
||||
function attachTo(aWindow) {
|
||||
if (gWindow != null) {
|
||||
info("attempting to attach to a second window [" + aWindow + "] while already attached to one window [" + gWindow + "]");
|
||||
return;
|
||||
}
|
||||
gWindow = aWindow;
|
||||
setTimeout(startTest, 0);
|
||||
}
|
||||
|
||||
function detachFrom(aWindow) {
|
||||
if (gWindow == aWindow) {
|
||||
gWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
function startup() {
|
||||
var enumerator = Services.wm.getEnumerator("navigator:browser");
|
||||
while (enumerator.hasMoreElements()) {
|
||||
// potential race condition here - the window may not be ready yet at
|
||||
// this point, so ideally we would test for that. but i can't find a
|
||||
// property that reflects whether or not UIReady has been fired, so
|
||||
// for now just assume the window is ready
|
||||
attachTo(enumerator.getNext().QueryInterface(Ci.nsIDOMWindow));
|
||||
}
|
||||
Services.wm.addListener(browserListener);
|
||||
}
|
||||
|
||||
function startTest() {
|
||||
checkpoint("Fresh start");
|
||||
setTimeout(settle, 30000);
|
||||
}
|
||||
|
||||
function settle() {
|
||||
checkpoint("Fresh start [+30s]");
|
||||
openTab();
|
||||
}
|
||||
|
||||
function openTab() {
|
||||
var urlIndex = gTabsOpened++;
|
||||
if (urlIndex >= kUrls.length) {
|
||||
checkpoint("After tabs");
|
||||
setTimeout(postOpening, 30000);
|
||||
return;
|
||||
}
|
||||
|
||||
info("opening tab with url [" + kUrls[urlIndex] + "]");
|
||||
gLastTab = BrowserApp.addTab(kUrls[urlIndex], { selected: true });
|
||||
setTimeout(waitForTab, 10000);
|
||||
}
|
||||
|
||||
function waitForTab() {
|
||||
if (gLastTab.browser.contentDocument.readyState === "complete") {
|
||||
gLastTab = null;
|
||||
openTab();
|
||||
} else {
|
||||
setTimeout(waitForTab, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
function postOpening() {
|
||||
checkpoint("After tabs [+30s]");
|
||||
doFullGc(() => closeTabs());
|
||||
}
|
||||
|
||||
function closeTabs() {
|
||||
checkpoint("After tabs [+30s, forced GC]");
|
||||
var tabCount = BrowserApp.tabs.length;
|
||||
for (var i = 1; i < tabCount; i++) {
|
||||
BrowserApp.closeTab(BrowserApp.tabs[i]);
|
||||
}
|
||||
|
||||
var closeListener = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
tabCount--;
|
||||
dump("tab count dropped to [" + tabCount + "]");
|
||||
if (tabCount == 1) {
|
||||
Services.obs.removeObserver(this, "Tab:Closed", false);
|
||||
setTimeout(tabsClosed, 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
Services.obs.addObserver(closeListener, "Tab:Closed", false);
|
||||
}
|
||||
|
||||
function tabsClosed() {
|
||||
checkpoint("Tabs closed");
|
||||
setTimeout(postClosing, 30000);
|
||||
}
|
||||
|
||||
function postClosing() {
|
||||
checkpoint("Tabs closed [+30s]");
|
||||
doFullGc(() => {
|
||||
checkpoint("Tabs closed [+30s, forced GC]");
|
||||
finalReport();
|
||||
ok(true, "memory logging complete -- view results in Perfherder");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
function geomean(aProperty) {
|
||||
// https://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms
|
||||
var logsum = 0;
|
||||
var i;
|
||||
for (i = 0; i < gResults.length; i++) {
|
||||
var result = gResults[i];
|
||||
logsum += Math.log(result[aProperty]);
|
||||
}
|
||||
return Math.round(Math.exp(logsum/gResults.length));
|
||||
}
|
||||
|
||||
function finalReport() {
|
||||
var i;
|
||||
var perfherder = "PERFHERDER_DATA: ";
|
||||
perfherder += "{\"framework\": {\"name\": \"awsy\"}, ";
|
||||
perfherder += "\"suites\": [";
|
||||
perfherder += "{\"name\": \"Resident Memory\", ";
|
||||
perfherder += "\"subtests\": [";
|
||||
for (i = 0; i < gResults.length; i++) {
|
||||
var result = gResults[i];
|
||||
if (i > 0) {
|
||||
perfherder += ", ";
|
||||
}
|
||||
perfherder += `{\"name\": \"${result.name}\", \"value\": ${result.resident}}`;
|
||||
}
|
||||
perfherder += "], "; // end subtests
|
||||
perfherder += "\"value\": "+geomean("resident");
|
||||
perfherder += "}"; // end Resident Memory suite
|
||||
perfherder += "]"; // end suites
|
||||
perfherder += "}"; // end PERFHERDER_DATA
|
||||
info(perfherder);
|
||||
}
|
||||
|
||||
startup();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1233220">Mozilla Bug 1233220</a>
|
||||
<br>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1010750
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1010750</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { utils: Cu } = Components;
|
||||
|
||||
const DEBUGGER_USB_ENABLED = "devtools.remote.usb.enabled";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
const { require } =
|
||||
Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
win.RemoteDebugger.init();
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref(DEBUGGER_USB_ENABLED);
|
||||
});
|
||||
|
||||
// Enable the debugger via the pref it listens for
|
||||
Services.prefs.setBoolPref(DEBUGGER_USB_ENABLED, true);
|
||||
|
||||
ok(DebuggerServer.initialized, "initialized");
|
||||
is(DebuggerServer.listeningSockets, 1, "1 listening socket");
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1010750">Mozilla Bug 1010750</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testDebuggerServer</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1157319
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1157319</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// Load a custom sjs script that echos our "User-Agent" header back at us
|
||||
const TestURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/desktopmode_user_agent.sjs", null, null);
|
||||
|
||||
add_task(function* test_desktopmode() {
|
||||
let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Add a new 'desktop mode' tab with our test page
|
||||
let desktopTab = BrowserApp.addTab(TestURI.spec, { selected: true, parentId: BrowserApp.selectedTab.id, desktopMode: true });
|
||||
let desktopBrowser = desktopTab.browser;
|
||||
yield promiseBrowserEvent(desktopBrowser, "load");
|
||||
|
||||
// Some debugging
|
||||
info("desktop: " + desktopBrowser.contentWindow.navigator.userAgent);
|
||||
info("desktop: " + desktopBrowser.contentDocument.body.innerHTML);
|
||||
|
||||
// Check the server UA and the navigator UA for 'desktop'
|
||||
ok(desktopBrowser.contentWindow.navigator.userAgent.indexOf("Linux x86_64") != -1, "window.navigator.userAgent has 'Linux' in it");
|
||||
ok(desktopBrowser.contentDocument.body.innerHTML.indexOf("Linux x86_64") != -1, "HTTP header 'User-Agent' has 'Linux' in it");
|
||||
|
||||
BrowserApp.closeTab(desktopTab);
|
||||
|
||||
// Add a new 'mobile mode' tab with our test page
|
||||
let mobileTab = BrowserApp.addTab(TestURI.spec, { selected: true, parentId: BrowserApp.selectedTab.id });
|
||||
let mobileBrowser = mobileTab.browser;
|
||||
yield promiseBrowserEvent(mobileBrowser, "load");
|
||||
|
||||
// Some debugging
|
||||
info("mobile: " + mobileBrowser.contentWindow.navigator.userAgent);
|
||||
info("mobile: " + mobileBrowser.contentDocument.body.innerHTML);
|
||||
|
||||
// Check the server UA and the navigator UA for 'mobile'
|
||||
// We only check for 'Android' because we don't know the version or if it's phone or tablet
|
||||
ok(mobileBrowser.contentWindow.navigator.userAgent.indexOf("Android") != -1, "window.navigator.userAgent has 'Android' in it");
|
||||
ok(mobileBrowser.contentDocument.body.innerHTML.indexOf("Android") != -1, "HTTP header 'User-Agent' has 'Android' in it");
|
||||
|
||||
BrowserApp.closeTab(mobileTab);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1157319">Mozilla Bug 1157319</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testDesktopUseragent</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=861164
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 861164</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function search_observer(aSubject, aTopic, aData) {
|
||||
let engine = aSubject.QueryInterface(Ci.nsISearchEngine);
|
||||
info("Observer: " + aData + " for " + engine.name);
|
||||
|
||||
if (aData != "engine-added")
|
||||
return;
|
||||
|
||||
if (engine.name != "Test search engine")
|
||||
return;
|
||||
|
||||
function check_submission(aExpected, aSearchTerm, aType) {
|
||||
is(engine.getSubmission(aSearchTerm, aType).uri.spec, "http://example.com/search" + aExpected, "submission matches");
|
||||
}
|
||||
|
||||
// Force the type and check for the expected URL
|
||||
check_submission("?q=foo", "foo", "text/html");
|
||||
check_submission("/tablet?q=foo", "foo", "application/x-moz-tabletsearch");
|
||||
check_submission("/phone?q=foo", "foo", "application/x-moz-phonesearch");
|
||||
|
||||
// Let the service pick the appropriate type based on the device
|
||||
// and check for expected URL
|
||||
let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
|
||||
if (sysInfo.get("tablet")) {
|
||||
info("Device: tablet");
|
||||
check_submission("/tablet?q=foo", "foo", null);
|
||||
} else {
|
||||
info("Device: phone");
|
||||
check_submission("/phone?q=foo", "foo", null);
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
};
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
Services.obs.removeObserver(search_observer, "browser-search-engine-modified");
|
||||
});
|
||||
Services.obs.addObserver(search_observer, "browser-search-engine-modified", false);
|
||||
info("Loading search engine");
|
||||
Services.search.addEngine("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/devicesearch.xml", Ci.nsISearchEngine.DATA_XML, null, false);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861164">Mozilla Bug 861164</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testDeviceSearchEngine</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
106
mobile/android/tests/browser/chrome/test_get_last_visited.html
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1214366
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1214366</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
function get_last_visited(prePath) {
|
||||
return Messaging.sendRequestForResult({
|
||||
type: "History:GetPrePathLastVisitedTimeMilliseconds",
|
||||
prePath: prePath,
|
||||
});
|
||||
};
|
||||
|
||||
var browser = BrowserApp.addTab("about:blank").browser;
|
||||
|
||||
// It's useful to see *all* "link-visited" events in the face of intermittent failures.
|
||||
let observe = function(subject, topic, data) {
|
||||
var uri = subject.QueryInterface(Ci.nsIURI);
|
||||
info("Witnessed " + topic + " notification from Gecko with URI " + uri.spec);
|
||||
}
|
||||
Services.obs.addObserver(observe, "link-visited", false);
|
||||
|
||||
SimpleTest.registerCleanupFunction(function cleanup() {
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
Services.obs.removeObserver(observe, "link-visited");
|
||||
});
|
||||
|
||||
// N.b.: the write to the Fennec DB happens before the Gecko notification
|
||||
// is fired. This is delicate.
|
||||
function add_history_visit(url) {
|
||||
browser.loadURI(url, null, null);
|
||||
return promiseLinkVisit(url);
|
||||
};
|
||||
|
||||
// Be aware that some paths under mochi.test and example.org redirect. The
|
||||
// blank robocop pages appear to not. Redirects can impact this test, since
|
||||
// they can write to the history database.
|
||||
|
||||
// The apparent mis-ordering here just uses simpler pages (01 and 03) for the
|
||||
// real test, and a more complex page (02) for a final delay. See comment below.
|
||||
const url1 = "http://example.org/tests/robocop/robocop_blank_01.html";
|
||||
const url2 = "http://example.org/tests/robocop/robocop_blank_03.html";
|
||||
const url3 = "http://example.org/tests/robocop/robocop_blank_02.html";
|
||||
|
||||
add_task(function* test_get_last_visited() {
|
||||
var v = yield get_last_visited("https://random.com/");
|
||||
is(v, 0, `Last visited timestamp is 0 for unknown prePath: ${v}`);
|
||||
|
||||
let prePath = Services.io.newURI(url1, null, null).prePath + "/";
|
||||
is(prePath, Services.io.newURI(url2, null, null).prePath + "/", "url1 and url2 have the same prePath");
|
||||
|
||||
let t0 = Date.now();
|
||||
yield add_history_visit(url1);
|
||||
v = yield get_last_visited(prePath);
|
||||
let t1 = Date.now();
|
||||
ok(t0 <= v, `Last visited timestamp is after visit: ${t0} <= ${v}.`);
|
||||
ok(v <= t1, `Last visited timestamp is before present ${v} <= ${t1}.`);
|
||||
|
||||
let t2 = Date.now();
|
||||
yield add_history_visit(url1);
|
||||
v = yield get_last_visited(prePath);
|
||||
ok(t2 <= v, `Last visited timestamp is updated after visit: ${t2} <= ${v}`);
|
||||
|
||||
let t3 = Date.now();
|
||||
yield add_history_visit(url2);
|
||||
v = yield get_last_visited(prePath);
|
||||
ok(t3 <= v, `Last visited timestamp is updated after visit to URL with same prePath: ${t3} <= ${v}`);
|
||||
|
||||
// This whole system is flaky, so we wait for an unrelated visit, so that we
|
||||
// can witness "link-visited" events a little after the test completes
|
||||
// while debugging.
|
||||
yield add_history_visit(url3);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1214366">Mozilla Bug 1214366</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1178722
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1178722</title>
|
||||
<style>
|
||||
.hideme {display:none}
|
||||
</style>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
"use strict";
|
||||
|
||||
const VISIBLE_OPTION_COUNT = 5;
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let SelectHelper = win.SelectHelper;
|
||||
|
||||
// Returns whether an element should be visible according to its text content.
|
||||
function shouldBeVisible(e){
|
||||
return e.label.indexOf("visible") > 0;
|
||||
}
|
||||
|
||||
// Returns an object for the callback method that would normally be created by Prompt.java's
|
||||
// addListResult(..) method.
|
||||
function createCallBackDummyData(select){
|
||||
var dummyList = new Array();
|
||||
let listElements = SelectHelper.getListForElement(select);
|
||||
for (var i = 0; i < listElements.length; i++) {
|
||||
dummyList.push(i);
|
||||
}
|
||||
return {list:dummyList};
|
||||
}
|
||||
|
||||
// Wait until the page has loaded so that we can access the DOM.
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.onload = function () {
|
||||
let select = document.getElementById("sample-select");
|
||||
|
||||
// ##############################################
|
||||
// ### Testing SelectHelper.getListForElement ###
|
||||
// ##############################################
|
||||
|
||||
// Check that SelectHelper.getListForElement only includes visible options...
|
||||
let listElements = SelectHelper.getListForElement(select);
|
||||
for (var i = 0; i < listElements.length; i++) {
|
||||
ok(shouldBeVisible(listElements[i]), "Element should be visible: " + listElements[i]);
|
||||
}
|
||||
|
||||
// Check SelectHelper.getListForElement does not include additional options...
|
||||
is(listElements.length, VISIBLE_OPTION_COUNT, "Correct number of elements were returned.");
|
||||
|
||||
// ############################################
|
||||
// ### Testing SelectHelper._promptCallBack ###
|
||||
// ############################################
|
||||
|
||||
// We will simulate "selecting" (ie choosing via the prompt) all the visible options...
|
||||
is(select.selectedOptions.length, 0, "No options selected yet.");
|
||||
let dummyData = createCallBackDummyData(select);
|
||||
SelectHelper._promptCallBack(dummyData,select);
|
||||
|
||||
// Check that only the visible options had the "selected" attribute set...
|
||||
let selectedOptions = select.selectedOptions;
|
||||
for (var i = 0; i < selectedOptions.length; i++) {
|
||||
ok(shouldBeVisible(selectedOptions[i]), "Element should be visible.");
|
||||
}
|
||||
|
||||
// Check that no additional options had the "selected" attribute set...
|
||||
is(selectedOptions.length, VISIBLE_OPTION_COUNT, "Correct number of options were selected.");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="display">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1178722">Mozilla Bug 1178722</a>
|
||||
<select multiple id="sample-select">
|
||||
<option value="1">1 - visible</option> 0
|
||||
<option value="2" style="display: none">2 - hidden</option> 1
|
||||
<option value="3">3 - visible</option> 2
|
||||
<option value="4" style="display: nOnE">4 - hidden </option> 3
|
||||
<option value="5">5 - visible</option> 4
|
||||
<option value="6" class="hideme">6 - hidden</option> 5
|
||||
<option value="7">7 - visible</option> 6
|
||||
<option value="8" hiddEn>8 - hidden</option> 7
|
||||
<option value="9">9 - visible</option> 8
|
||||
</select>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
165
mobile/android/tests/browser/chrome/test_home_provider.html
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=942288
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 942288</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/HomeProvider.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Sqlite.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
const TEST_DATASET_ID = "test-dataset-id";
|
||||
const TEST_URL = "http://test.com";
|
||||
const TEST_TITLE = "Test";
|
||||
const TEST_BACKGROUND_URL = "http://example.com/background";
|
||||
const TEST_BACKGROUND_COLOR = "#FF9500";
|
||||
|
||||
const PREF_SYNC_CHECK_INTERVAL_SECS = "home.sync.checkIntervalSecs";
|
||||
const TEST_INTERVAL_SECS = 1;
|
||||
|
||||
const DB_PATH = OS.Path.join(OS.Constants.Path.profileDir, "home.sqlite");
|
||||
|
||||
test_request_sync();
|
||||
test_periodic_sync();
|
||||
|
||||
function test_request_sync() {
|
||||
// The current implementation of requestSync is synchronous.
|
||||
let success = HomeProvider.requestSync(TEST_DATASET_ID, function callback(datasetId) {
|
||||
is(datasetId, TEST_DATASET_ID, "expected dataset ID");
|
||||
});
|
||||
|
||||
ok(success, "requestSync success");
|
||||
}
|
||||
|
||||
function test_periodic_sync() {
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref(PREF_SYNC_CHECK_INTERVAL_SECS);
|
||||
HomeProvider.removePeriodicSync(TEST_DATASET_ID);
|
||||
});
|
||||
|
||||
// Lower the check interval for testing purposes.
|
||||
Services.prefs.setIntPref(PREF_SYNC_CHECK_INTERVAL_SECS, TEST_INTERVAL_SECS);
|
||||
|
||||
HomeProvider.addPeriodicSync(TEST_DATASET_ID, TEST_INTERVAL_SECS, function callback(datasetId) {
|
||||
is(datasetId, TEST_DATASET_ID, "expected dataset ID");
|
||||
});
|
||||
}
|
||||
|
||||
add_task(function* test_save_and_delete() {
|
||||
// Use the HomeProvider API to save some data.
|
||||
let storage = HomeProvider.getStorage(TEST_DATASET_ID);
|
||||
yield storage.save([{
|
||||
title: TEST_TITLE,
|
||||
url: TEST_URL,
|
||||
background_url: TEST_BACKGROUND_URL,
|
||||
background_color: TEST_BACKGROUND_COLOR
|
||||
}]);
|
||||
|
||||
// Peek in the DB to make sure we have the right data.
|
||||
let db = yield Sqlite.openConnection({ path: DB_PATH });
|
||||
|
||||
// Make sure the items table was created.
|
||||
ok((yield db.tableExists("items")), "items table exists");
|
||||
|
||||
// Make sure the correct values for the item ended up in there.
|
||||
let result = yield db.execute("SELECT * FROM items", null, function onRow(row){
|
||||
is(row.getResultByName("dataset_id"), TEST_DATASET_ID, "expected dataset ID");
|
||||
is(row.getResultByName("url"), TEST_URL, "expected test url");
|
||||
is(row.getResultByName("background_url"), TEST_BACKGROUND_URL, "expected background url");
|
||||
is(row.getResultByName("background_color"), TEST_BACKGROUND_COLOR, "expected background color");
|
||||
});
|
||||
|
||||
// Use the HomeProvider API to delete the data.
|
||||
yield storage.deleteAll();
|
||||
|
||||
// Make sure the data was deleted.
|
||||
result = yield db.execute("SELECT * FROM items");
|
||||
is(result.length, 0, "length is 0");
|
||||
|
||||
db.close();
|
||||
});
|
||||
|
||||
add_task(function* test_row_validation() {
|
||||
// Use the HomeProvider API to save some data.
|
||||
let storage = HomeProvider.getStorage(TEST_DATASET_ID);
|
||||
|
||||
let invalidRows = [
|
||||
{ url: "url" },
|
||||
{ title: "title" },
|
||||
{ description: "description" },
|
||||
{ image_url: "image_url" }
|
||||
];
|
||||
|
||||
// None of these save calls should save anything
|
||||
for (let row of invalidRows) {
|
||||
try {
|
||||
yield storage.save([row]);
|
||||
} catch (e if e instanceof HomeProvider.ValidationError) {
|
||||
// Just catch and ignore validation errors
|
||||
}
|
||||
}
|
||||
|
||||
// Peek in the DB to make sure we have the right data.
|
||||
let db = yield Sqlite.openConnection({ path: DB_PATH });
|
||||
|
||||
// Make sure no data has been saved.
|
||||
let result = yield db.execute("SELECT * FROM items");
|
||||
is(result.length, 0, "length is 0");
|
||||
|
||||
db.close();
|
||||
});
|
||||
|
||||
add_task(function* test_save_transaction() {
|
||||
// Use the HomeProvider API to save some data.
|
||||
let storage = HomeProvider.getStorage(TEST_DATASET_ID);
|
||||
|
||||
// One valid, one invalid
|
||||
let rows = [
|
||||
{ title: TEST_TITLE, url: TEST_URL },
|
||||
{ image_url: "image_url" }
|
||||
];
|
||||
|
||||
// Try to save all the rows at once
|
||||
try {
|
||||
yield storage.save(rows);
|
||||
} catch (e if e instanceof HomeProvider.ValidationError) {
|
||||
// Just catch and ignore validation errors
|
||||
}
|
||||
|
||||
// Peek in the DB to make sure we have the right data.
|
||||
let db = yield Sqlite.openConnection({ path: DB_PATH });
|
||||
|
||||
// Make sure no data has been saved.
|
||||
let result = yield db.execute("SELECT * FROM items");
|
||||
is(result.length, 0, "length is 0");
|
||||
|
||||
db.close();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=942288">Mozilla Bug 942288</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testHomeProvider</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
58
mobile/android/tests/browser/chrome/test_identity_mode.html
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1099088
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for getIdentityMode</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let IdentityHandler = chromeWin.IdentityHandler;
|
||||
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
|
||||
"'about:' is a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:config", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
|
||||
"'about:config' is a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
|
||||
"'about:accounts is a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:addonss", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
|
||||
"'about:addonss is not a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accountss", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
|
||||
"'about:accountss is not a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts?action=signup", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
|
||||
"'about:accounts?action=signup is a verified internal page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:evil_extension_page", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
|
||||
"'about:evil_extension_page' is not a verified internal page");
|
||||
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("http://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
|
||||
"http://mozilla.com is an unknown page");
|
||||
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("https://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
|
||||
"https://mozilla.com over an insecure connection is an unknown page");
|
||||
ok(IdentityHandler.getIdentityMode(Ci.nsIWebProgressListener.STATE_IS_SECURE, Services.io.newURI("https://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_IDENTIFIED,
|
||||
"https://mozilla.com over a secure connection is a verified page");
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1099088">Mozilla Bug 1099088</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
118
mobile/android/tests/browser/chrome/test_java_addons.html
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1168407
|
||||
Migrated from Robocop https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1168407</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/JavaAddonManager.jsm"); /*global JavaAddonManager */
|
||||
Cu.import("resource://gre/modules/Promise.jsm"); /*global Promise */
|
||||
Cu.import("resource://gre/modules/Task.jsm"); /*global Task */
|
||||
|
||||
const DEX_FILE = "chrome://roboextender/content/javaaddons-test.apk";
|
||||
const CLASS = "org.mozilla.javaaddons.test.JavaAddonV1";
|
||||
|
||||
const MESSAGE = "JavaAddon:V1";
|
||||
|
||||
add_task(function* testFailureCases() {
|
||||
info("Loading Java Addon from non-existent class.");
|
||||
let gotError1 = yield JavaAddonManager.classInstanceFromFile(CLASS + "GARBAGE", DEX_FILE)
|
||||
.then((result) => false)
|
||||
.catch((error) => true);
|
||||
is(gotError1, true, "got expected error for non-existent class");
|
||||
|
||||
info("Loading Java Addon from non-existent DEX file.");
|
||||
let gotError2 = yield JavaAddonManager.classInstanceFromFile(CLASS, DEX_FILE + "GARBAGE")
|
||||
.then((result) => false)
|
||||
.catch((error) => true);
|
||||
is(gotError2, true, "got expected error for non-existent DEX file");
|
||||
});
|
||||
|
||||
// Make a request to a dynamically loaded Java Addon; wait for a response.
|
||||
// Then expect the add-on to make a request; respond.
|
||||
// Then expect the add-on to make a second request; use it to verify the response to the first request.
|
||||
add_task(function* testJavaAddonV1() {
|
||||
info("Loading Java Addon from: " + DEX_FILE);
|
||||
|
||||
let javaAddon = yield JavaAddonManager.classInstanceFromFile(CLASS, DEX_FILE);
|
||||
isnot(javaAddon, null, "addon is not null");
|
||||
isnot(javaAddon._guid, null, "guid is not null");
|
||||
is(javaAddon._classname, CLASS, "got expected class");
|
||||
is(javaAddon._loaded, true, "addon is loaded");
|
||||
|
||||
let messagePromise = Promise.defer();
|
||||
var count = 0;
|
||||
function listener(data) {
|
||||
info("Got request initiated from Java Addon: " + data + ", " + typeof(data) + ", " + JSON.stringify(data));
|
||||
count += 1;
|
||||
messagePromise.resolve(); // It's okay to resolve before returning: we'll wait on the verification promise no matter what.
|
||||
return {
|
||||
outputStringKey: "inputStringKey=" + data.inputStringKey,
|
||||
outputIntKey: data.inputIntKey - 1
|
||||
};
|
||||
}
|
||||
javaAddon.addListener(listener, "JavaAddon:V1:Request");
|
||||
|
||||
let verifierPromise = Promise.defer();
|
||||
function verifier(data) {
|
||||
info("Got verification request initiated from Java Addon: " + data + ", " + typeof(data) + ", " + JSON.stringify(data));
|
||||
// These values are from the test Java Addon, after being processed by the :Request listener above.
|
||||
is(data.outputStringKey, "inputStringKey=raw", "got expected outputStringKey");
|
||||
is(data.outputIntKey, 2, "got expected outputIntKey");
|
||||
verifierPromise.resolve();
|
||||
return {};
|
||||
}
|
||||
javaAddon.addListener(verifier, "JavaAddon:V1:VerificationRequest");
|
||||
|
||||
let message = {type: MESSAGE, inputStringKey: "test", inputIntKey: 5};
|
||||
info("Sending request to Java Addon: " + JSON.stringify(message));
|
||||
let output = yield javaAddon.sendRequestForResult(message);
|
||||
|
||||
info("Got response from Java Addon: " + output + ", " + typeof(output) + ", " + JSON.stringify(output));
|
||||
is(output.outputStringKey, "inputStringKey=test", "got expected outputStringKey");
|
||||
is(output.outputIntKey, 6, "got expected outputIntKey");
|
||||
|
||||
// We don't worry about timing out: the harness will (very much later)
|
||||
// kill us if we don't see the expected messages.
|
||||
|
||||
info("Waiting for request initiated from Java Addon.");
|
||||
yield messagePromise.promise;
|
||||
is(count, 1, "count is 1");
|
||||
|
||||
info("Send request for result 2 for request initiated from Java Addon.");
|
||||
|
||||
// The JavaAddon should have removed its listener, so we shouldn't get a response and count should stay the same.
|
||||
let gotError = yield javaAddon.sendRequestForResult(message)
|
||||
.then((result) => false)
|
||||
.catch((error) => true);
|
||||
is(gotError, true, "got expected error");
|
||||
is(count, 1, "count is still 1");
|
||||
|
||||
info("Waiting for verification request initiated from Java Addon.");
|
||||
yield verifierPromise.promise;
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1168407">Mozilla Bug 1168407</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testJavaAddons</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
82
mobile/android/tests/browser/chrome/test_jni.html
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=873569
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 873569</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
Components.utils.import("resource://gre/modules/ctypes.jsm");
|
||||
Components.utils.import("resource://gre/modules/JNI.jsm");
|
||||
|
||||
function test_JNI() {
|
||||
var jenv = null;
|
||||
try {
|
||||
jenv = JNI.GetForThread();
|
||||
|
||||
// Test a simple static method.
|
||||
var geckoAppShell = JNI.LoadClass(jenv, "org.mozilla.gecko.GeckoAppShell", {
|
||||
static_methods: [
|
||||
{ name: "getPreferredIconSize", sig: "()I" },
|
||||
{ name: "getContext", sig: "()Landroid/content/Context;" },
|
||||
],
|
||||
});
|
||||
|
||||
let iconSize = -1;
|
||||
iconSize = geckoAppShell.getPreferredIconSize();
|
||||
isnot(iconSize, -1, "icon size is valid");
|
||||
|
||||
// Test GeckoNetworkManager methods that are accessed by PaymentsUI.js.
|
||||
// The return values can vary, so we can't test for equivalence, but we
|
||||
// can ensure that the method calls return values of the correct type.
|
||||
let jGeckoNetworkManager = JNI.LoadClass(jenv, "org/mozilla/gecko/GeckoNetworkManager", {
|
||||
static_methods: [
|
||||
{ name: "getMNC", sig: "()I" },
|
||||
{ name: "getMCC", sig: "()I" },
|
||||
],
|
||||
});
|
||||
is(typeof jGeckoNetworkManager.getMNC(), "number", "typeof getMNC is number");
|
||||
is(typeof jGeckoNetworkManager.getMCC(), "number", "typeof getMCC is number");
|
||||
|
||||
// Test retrieving the context's class's name, which tests dynamic method
|
||||
// invocation as well as converting a Java string to JavaScript.
|
||||
JNI.LoadClass(jenv, "android.content.Context", {
|
||||
methods: [
|
||||
{ name: "getClass", sig: "()Ljava/lang/Class;" },
|
||||
],
|
||||
});
|
||||
JNI.LoadClass(jenv, "java.lang.Class", {
|
||||
methods: [
|
||||
{ name: "getName", sig: "()Ljava/lang/String;" },
|
||||
],
|
||||
});
|
||||
is("org.mozilla.gecko.BrowserApp", JNI.ReadString(jenv, geckoAppShell.getContext().getClass().getName()), "class name is correct");
|
||||
} finally {
|
||||
if (jenv) {
|
||||
JNI.UnloadClasses(jenv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test_JNI();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=873569">Mozilla Bug 873569</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testJNI</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
57
mobile/android/tests/browser/chrome/test_migrate_ui.html
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1154504
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1154504</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head_search.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
Services.prefs.clearUserPref("browser.migration.version");
|
||||
Services.prefs.setBoolPref("nglayout.debug.paint_flashing", true);
|
||||
|
||||
addTestEngines([
|
||||
{ name: "bacon", details: ["", "bacon", "Search Bacon", "GET",
|
||||
"http://www.bacon.moz/?search={searchTerms}"] },
|
||||
]).then(engines => {
|
||||
Services.prefs.setCharPref("browser.search.defaultenginename", engines[0].name);
|
||||
|
||||
let BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
|
||||
|
||||
// This performs the serach migration asynchronously, but the search service is already initialized
|
||||
// by `addTestEngines`, so we don't need to worry about waiting before checking the new engine.
|
||||
BrowserApp._migrateUI();
|
||||
|
||||
// Check that migration version increased.
|
||||
is(Services.prefs.getIntPref("browser.migration.version"), 3, "found expected version");
|
||||
|
||||
// Check that user pref value was reset.
|
||||
is(Services.prefs.prefHasUserValue("nglayout.debug.paint_flashing"), false, "found expected user value");
|
||||
|
||||
function searchObserver(s, t, d) {
|
||||
Services.obs.removeObserver(searchObserver, "default-search-engine-migrated");
|
||||
is(Services.search.defaultEngine.name, engines[0].name, "found expected default search engine");
|
||||
}
|
||||
Services.obs.addObserver(searchObserver, "default-search-engine-migrated", false);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1154504">Mozilla Bug 1154504</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testMigrateUI</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=895775
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 895775</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// Let's exercise the interface. Even if the network is not up, we can make sure nothing blows up.
|
||||
let network = Cc["@mozilla.org/network/network-link-service;1"].getService(Ci.nsINetworkLinkService);
|
||||
if (network.isLinkUp) {
|
||||
ok(network.linkType != Ci.nsINetworkLinkService.LINK_TYPE_UNKNOWN, "LinkType is not UNKNOWN");
|
||||
} else {
|
||||
ok(network.linkType == Ci.nsINetworkLinkService.LINK_TYPE_UNKNOWN, "LinkType is UNKNOWN");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=895775">Mozilla Bug 895775</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testNetworkManager</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
111
mobile/android/tests/browser/chrome/test_offline_page.html
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1089190
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1089190</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
// Provide a helper to yield until we are sure the offline state has changed
|
||||
function promiseOffline(isOffline) {
|
||||
return new Promise((resolve, reject) => {
|
||||
function observe(subject, topic, data) {
|
||||
info("Received topic: " + topic);
|
||||
Services.obs.removeObserver(observe, "network:offline-status-changed");
|
||||
resolve();
|
||||
}
|
||||
Services.obs.addObserver(observe, "network:offline-status-changed", false);
|
||||
Services.io.offline = isOffline;
|
||||
});
|
||||
}
|
||||
|
||||
// The chrome window
|
||||
let chromeWin;
|
||||
|
||||
// Track the <browser> where the tests are happening
|
||||
let browser;
|
||||
|
||||
// The proxy setting
|
||||
let proxyPrefValue;
|
||||
|
||||
const kUniqueURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_controls.html", null, null);
|
||||
|
||||
add_task(function* test_offline() {
|
||||
// Tests always connect to localhost, and per bug 87717, localhost is now
|
||||
// reachable in offline mode. To avoid this, disable any proxy.
|
||||
proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
|
||||
Services.prefs.setIntPref("network.proxy.type", 0);
|
||||
|
||||
// Clear network cache.
|
||||
Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService).clear();
|
||||
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Add a new tab with a blank page so we can better control the real page load and the offline state
|
||||
browser = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
|
||||
Services.io.offline = false;
|
||||
});
|
||||
|
||||
// Go offline, expecting the error page.
|
||||
yield promiseOffline(true);
|
||||
|
||||
// Load our test web page
|
||||
browser.loadURI(kUniqueURI.spec, null, null)
|
||||
yield promiseBrowserEvent(browser, "DOMContentLoaded");
|
||||
|
||||
// This is an error page.
|
||||
is(browser.contentDocument.documentURI.substring(0, 27), "about:neterror?e=netOffline", "Document URI is the error page.");
|
||||
|
||||
// But location bar should show the original request.
|
||||
is(browser.contentWindow.location.href, kUniqueURI.spec, "Docshell URI is the original URI.");
|
||||
|
||||
Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
|
||||
|
||||
// Go online and try to load the page again
|
||||
yield promiseOffline(false);
|
||||
|
||||
ok(browser.contentDocument.getElementById("errorTryAgain"), "The error page has got a #errorTryAgain element");
|
||||
|
||||
// Click "Try Again" button to start the page load
|
||||
browser.contentDocument.getElementById("errorTryAgain").click();
|
||||
yield promiseBrowserEvent(browser, "DOMContentLoaded");
|
||||
|
||||
// This is not an error page.
|
||||
is(browser.contentDocument.documentURI, kUniqueURI.spec, "Document URI is not the offline-error page, but the original URI.");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1089190">Mozilla Bug 1089190</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testOfflinePage</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
56
mobile/android/tests/browser/chrome/test_reader_view.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1158885
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1158885</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
add_task(function* test_reader_view_visibility() {
|
||||
let gWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = gWin.BrowserApp;
|
||||
|
||||
let url = "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/basic_article.html";
|
||||
let browser = BrowserApp.addTab("about:reader?url=" + url).browser;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
let doc = browser.contentDocument;
|
||||
let title = doc.getElementById("reader-title");
|
||||
|
||||
// We need to wait for reader content to appear because AboutReader.jsm
|
||||
// asynchronously fetches the content after about:reader loads.
|
||||
yield promiseNotification("AboutReader:Ready");
|
||||
is(title.textContent, "Article title", "found expected content");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1158885">Mozilla Bug 1158885</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testReaderView</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=948465
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 948465</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm"); /*global Promise */
|
||||
Cu.import("resource://gre/modules/Services.jsm"); /*global Services */
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm"); /*global NetUtil */
|
||||
|
||||
function readChannel(url) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
|
||||
|
||||
channel.contentType = "text/plain";
|
||||
|
||||
NetUtil.asyncFetch(channel, function(inputStream, status) {
|
||||
if (!Components.isSuccessCode(status)) {
|
||||
deferred.reject();
|
||||
return;
|
||||
}
|
||||
|
||||
let content = NetUtil.readInputStreamToString(inputStream, inputStream.available());
|
||||
deferred.resolve(content);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
add_task(function* () {
|
||||
let protocolHandler = Services.io
|
||||
.getProtocolHandler("resource")
|
||||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
|
||||
ok(protocolHandler.hasSubstitution("android"));
|
||||
|
||||
// This can be any file that we know exists in the root of every APK.
|
||||
let packageName = yield readChannel("resource://android/package-name.txt");
|
||||
info(packageName);
|
||||
|
||||
// It's difficult to fish ANDROID_PACKAGE_NAME from JavaScript, so we test the
|
||||
// following weaker condition.
|
||||
let expectedPrefix = "org.mozilla.";
|
||||
is(packageName.substring(0, expectedPrefix.length), expectedPrefix);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=948465">Mozilla Bug 948465</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testResourceSubstitutions</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1042715
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1042715</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/ctypes.jsm");
|
||||
Cu.import("resource://gre/modules/JNI.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
function test_isUserRestricted() {
|
||||
// Make sure the parental controls service is available
|
||||
ok("@mozilla.org/parental-controls-service;1" in Cc);
|
||||
|
||||
let pc = Cc["@mozilla.org/parental-controls-service;1"].createInstance(Ci.nsIParentalControlsService);
|
||||
|
||||
// In an admin profile, like the tests: enabled = false
|
||||
// In a restricted profile: enabled = true
|
||||
ok(!pc.parentalControlsEnabled);
|
||||
ok(!pc.blockFileDownloadsEnabled);
|
||||
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.DOWNLOAD));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_EXTENSION));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_APP));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.BROWSE));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.SHARE));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.BOOKMARK));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_EXTENSION));
|
||||
ok(pc.isAllowed(Ci.nsIParentalControlsService.MODIFY_ACCOUNTS));
|
||||
}
|
||||
|
||||
test_isUserRestricted();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1042715">Mozilla Bug 1042715</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testRestrictedProfiles</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1263589
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1263589</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
"use strict";
|
||||
|
||||
const VISIBLE_OPTION_COUNT = 5;
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let SelectHelper = win.SelectHelper;
|
||||
|
||||
// Wait until the page has loaded so that we can access the DOM.
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.onload = function () {
|
||||
// test options are not incorrectly disabled...
|
||||
let isEnabled1 = document.getElementById("is_enabled_1");
|
||||
let isEnabled2 = document.getElementById("is_enabled_2");
|
||||
ok(!SelectHelper._isDisabledElement(isEnabled1),"input with name=\"disabled\" should not disable options (bug 1263589)");
|
||||
ok(!SelectHelper._isDisabledElement(isEnabled2),"<form disabled> is not valid and will have no effect.");
|
||||
|
||||
// test options are disabled when expected...
|
||||
let isNotEnabled1 = document.getElementById("is_not_enabled_1");
|
||||
let isNotEnabled2 = document.getElementById("is_not_enabled_2");
|
||||
let isNotEnabled3 = document.getElementById("is_not_enabled_2");
|
||||
ok(SelectHelper._isDisabledElement(isNotEnabled1),"<option disabled> is disabled.");
|
||||
ok(SelectHelper._isDisabledElement(isNotEnabled2),"<optelement disabled> will have disabled children.");
|
||||
ok(SelectHelper._isDisabledElement(isNotEnabled3),"<fieldset disabled> will have disabled children.");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="display">
|
||||
|
||||
<form>
|
||||
<!-- This input field is to confused SelectHelper._isDisabledElement(e). See bug 1263589 for details.-->
|
||||
<input type="text" id="disabled" name="disabled" value="disabled" disabled="disabled">
|
||||
|
||||
<select>
|
||||
<option id="is_enabled_1">A</option>
|
||||
<option disabled id="is_not_enabled_1">C</option>
|
||||
<optgroup disabled>
|
||||
<option id="is_not_enabled_2">B</option>
|
||||
<option>C</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
|
||||
<fieldset disabled>
|
||||
<select>
|
||||
<option>F</option>
|
||||
<option id="is_not_enabled_3">G</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
<form disabled>
|
||||
<!-- "Disabled" is not a valid attribute for <form> and so fields should not be disabled -->
|
||||
<select>
|
||||
<option id="is_enabled_2">D</option>
|
||||
<option>E</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
92
mobile/android/tests/browser/chrome/test_selectoraddtab.html
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1216047
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1216047</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
// The chrome window
|
||||
let chromeWin;
|
||||
|
||||
// Track the <browser>s where the tests are happening
|
||||
let browserBlank;
|
||||
let browserTest;
|
||||
|
||||
const kTestPage = "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/basic_article.html";
|
||||
|
||||
add_task(function* test_selectOrAdd() {
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browserBlank));
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browserTest));
|
||||
});
|
||||
|
||||
// Add a new tab with a blank page
|
||||
browserBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
|
||||
// Now, let's force the target browser to be added
|
||||
browserTest = BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
yield promiseBrowserEvent(browserTest, "DOMContentLoaded");
|
||||
|
||||
// Check that basic_article is now selected
|
||||
is(BrowserApp.selectedBrowser, browserTest, "Target browser is selected after being added.");
|
||||
|
||||
// Switch back to about:blank
|
||||
BrowserApp.selectTab(BrowserApp.getTabForBrowser(browserBlank));
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
|
||||
// Check that about:blank is selected
|
||||
is(BrowserApp.selectedBrowser, browserBlank, "about:blank is selected.");
|
||||
|
||||
// Use selectOrAddTab to select the existing tab
|
||||
BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
|
||||
// Check that basic_article is now selected
|
||||
is(BrowserApp.selectedBrowser, browserTest, "Target browser is selected.");
|
||||
|
||||
// Switch back to about:blank
|
||||
BrowserApp.selectTab(BrowserApp.getTabForBrowser(browserBlank));
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
|
||||
// Check that about:blank is selected
|
||||
is(BrowserApp.selectedBrowser, browserBlank, "about:blank is selected.");
|
||||
|
||||
// Use selectOrAddTab to select the existing tab using the startsWith flag
|
||||
BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id }, { startsWith: kTestPage }).browser;
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
|
||||
// Check that basic_article is now selected
|
||||
is(BrowserApp.selectedBrowser, browserTest, "Target browser is selected.");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1216047">Mozilla Bug 1216047</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
274
mobile/android/tests/browser/chrome/test_session_form_data.html
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=671993
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1261225
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bugs 671993, 1261225</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
let gChromeWin;
|
||||
let gBrowserApp;
|
||||
|
||||
// Waiting for a tab to load or restore can be slow on the emulator.
|
||||
SimpleTest.requestLongerTimeout(2);
|
||||
|
||||
setup_browser();
|
||||
|
||||
function queryElement(contentWindow, data) {
|
||||
let frame = contentWindow;
|
||||
if (data.hasOwnProperty("frame")) {
|
||||
frame = contentWindow.frames[data.frame];
|
||||
}
|
||||
|
||||
let doc = frame.document;
|
||||
|
||||
if (data.hasOwnProperty("id")) {
|
||||
return doc.getElementById(data.id);
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty("selector")) {
|
||||
return doc.querySelector(data.selector);
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty("xpath")) {
|
||||
let xptype = Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
|
||||
return doc.evaluate(data.xpath, doc, null, xptype, null).singleNodeValue;
|
||||
}
|
||||
|
||||
throw new Error("couldn't query element");
|
||||
}
|
||||
|
||||
function dispatchUIEvent(input, type) {
|
||||
let event = input.ownerDocument.createEvent("UIEvents");
|
||||
event.initUIEvent(type, true, true, input.ownerDocument.defaultView, 0);
|
||||
input.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function setInputValue(browser, data) {
|
||||
let input = queryElement(browser.contentWindow, data);
|
||||
input.value = data.value;
|
||||
dispatchUIEvent(input, "input");
|
||||
}
|
||||
|
||||
function getInputValue(browser, data) {
|
||||
let input = queryElement(browser.contentWindow, data);
|
||||
return input.value;
|
||||
}
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
|
||||
function setup_browser() {
|
||||
gChromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
gBrowserApp = gChromeWin.BrowserApp;
|
||||
}
|
||||
|
||||
/**
|
||||
* This test ensures that form data collection respects the privacy level as
|
||||
* set by the user.
|
||||
*/
|
||||
add_task(function* test_formdata() {
|
||||
const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
|
||||
|
||||
const OUTER_VALUE = "browser_formdata_" + Math.random();
|
||||
const INNER_VALUE = "browser_formdata_" + Math.random();
|
||||
|
||||
// Creates a tab, loads a page with some form fields,
|
||||
// modifies their values and closes the tab.
|
||||
function createAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
let tab = gBrowserApp.addTab(URL);
|
||||
let browser = tab.browser;
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
// Modify form data.
|
||||
setInputValue(browser, {id: "txt", value: OUTER_VALUE});
|
||||
setInputValue(browser, {id: "txt", value: INNER_VALUE, frame: 0});
|
||||
|
||||
// Remove the tab.
|
||||
gBrowserApp.closeTab(tab);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveTab();
|
||||
let state = ss.getClosedTabs(gChromeWin);
|
||||
let [{formdata}] = state;
|
||||
is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
|
||||
is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
|
||||
|
||||
// Disable saving data for encrypted sites.
|
||||
Services.prefs.setIntPref("browser.sessionstore.privacy_level", 1);
|
||||
|
||||
yield createAndRemoveTab();
|
||||
state = ss.getClosedTabs(gChromeWin);
|
||||
[{formdata}] = state;
|
||||
is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
|
||||
ok(!formdata.children, "inner value was *not* stored");
|
||||
|
||||
// Disable saving data for any site.
|
||||
Services.prefs.setIntPref("browser.sessionstore.privacy_level", 2);
|
||||
|
||||
yield createAndRemoveTab();
|
||||
state = ss.getClosedTabs(gChromeWin);
|
||||
[{formdata}] = state;
|
||||
ok(!formdata, "form data has *not* been stored");
|
||||
|
||||
// Restore the default privacy level.
|
||||
Services.prefs.clearUserPref("browser.sessionstore.privacy_level");
|
||||
});
|
||||
|
||||
/**
|
||||
* This test ensures that form data collection restores correctly.
|
||||
*/
|
||||
add_task(function* test_formdata2() {
|
||||
const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
|
||||
|
||||
const OUTER_VALUE = "browser_formdata_" + Math.random();
|
||||
const INNER_VALUE = "browser_formdata_" + Math.random();
|
||||
|
||||
// Creates a tab, loads a page with some form fields,
|
||||
// modifies their values and closes the tab.
|
||||
function createAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
let tab = gBrowserApp.addTab(URL);
|
||||
let browser = tab.browser;
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
// Modify form data.
|
||||
setInputValue(browser, {id: "txt", value: OUTER_VALUE});
|
||||
setInputValue(browser, {id: "txt", value: INNER_VALUE, frame: 0});
|
||||
|
||||
// Remove the tab.
|
||||
gBrowserApp.closeTab(tab);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveTab();
|
||||
let state = ss.getClosedTabs(gChromeWin);
|
||||
let [{formdata}] = state;
|
||||
is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
|
||||
is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
|
||||
|
||||
// Restore the closed tab.
|
||||
let closedTabData = ss.getClosedTabs(gChromeWin)[0];
|
||||
let browser = ss.undoCloseTab(gChromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
// Check the form data.
|
||||
is(getInputValue(browser, {id: "txt"}), OUTER_VALUE, "outer value restored correctly");
|
||||
is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
gBrowserApp.closeTab(gBrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
/**
|
||||
* This test ensures that form data collection restores correctly even after
|
||||
* navigating to a different page and then returning via hitting back.
|
||||
*/
|
||||
add_task(function* test_formdata_navigation() {
|
||||
const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
|
||||
const otherURL = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article.html";
|
||||
|
||||
const OUTER_VALUE = "browser_formdata_" + Math.random();
|
||||
const INNER_VALUE = "browser_formdata_" + Math.random();
|
||||
|
||||
// Make sure the bfcache remains enabled during this test,
|
||||
// otherwise the inner value will not be restored correctly.
|
||||
Services.prefs.setBoolPref("browser.sessionhistory.bfcacheIgnoreMemoryPressure", true);
|
||||
Services.prefs.setIntPref("browser.sessionhistory.max_total_viewers", 1);
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
// Turn the bfcache memory pressure protection back off once we're finished.
|
||||
Services.prefs.clearUserPref("browser.sessionhistory.bfcacheIgnoreMemoryPressure");
|
||||
Services.prefs.clearUserPref("browser.sessionhistory.max_total_viewers");
|
||||
});
|
||||
|
||||
// Creates a tab, loads a page with some form fields, modifies their values,
|
||||
// navigates to a different page and back again and closes the tab.
|
||||
function createNavigateAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
let tab = gBrowserApp.addTab(URL);
|
||||
let browser = tab.browser;
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
// Modify form data.
|
||||
setInputValue(browser, {id: "txt", value: OUTER_VALUE});
|
||||
setInputValue(browser, {id: "txt", value: INNER_VALUE, frame: 0});
|
||||
|
||||
// Visit a different page.
|
||||
gBrowserApp.loadURI(otherURL, browser);
|
||||
yield promiseBrowserEvent(browser, "DOMContentLoaded");
|
||||
is(browser.currentURI.spec, otherURL, "navigated to a different page");
|
||||
|
||||
// Go back.
|
||||
is(browser.canGoBack, true, "can go back");
|
||||
browser.goBack();
|
||||
yield promiseTabEvent(browser, "SSTabDataUpdated");
|
||||
is(browser.currentURI.spec, URL, "navigated back to form data page");
|
||||
|
||||
// Make sure form data is still present.
|
||||
is(getInputValue(browser, {id: "txt"}), OUTER_VALUE, "outer value present after navigation");
|
||||
is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value present after navigation");
|
||||
|
||||
// Remove the tab.
|
||||
gBrowserApp.closeTab(tab);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createNavigateAndRemoveTab();
|
||||
let state = ss.getClosedTabs(gChromeWin);
|
||||
let [{formdata}] = state;
|
||||
is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
|
||||
is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
|
||||
|
||||
// Restore the closed tab.
|
||||
let closedTabData = ss.getClosedTabs(gChromeWin)[0];
|
||||
let browser = ss.undoCloseTab(gChromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "load");
|
||||
|
||||
// Check the form data.
|
||||
is(getInputValue(browser, {id: "txt"}), OUTER_VALUE, "outer value restored correctly");
|
||||
is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
gBrowserApp.closeTab(gBrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=671993">Mozilla Bug 671993</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1261225">Mozilla Bug 1261225</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testSessionFormData</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,310 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=810981
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 810981</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
/** Test for Bug 810981 **/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
// The chrome window.
|
||||
let chromeWin;
|
||||
|
||||
// Track the tabs where the tests are happening.
|
||||
let tabScroll;
|
||||
|
||||
// Use something with enough content to allow for scrolling.
|
||||
const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article_mobile.html";
|
||||
// Something to test the zoom level scaling on rotation with.
|
||||
const URL_desktop = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article.html";
|
||||
// Reader mode URL
|
||||
const URL_reader = "about:reader?url=http%3A%2F%2Fexample.org%2Fchrome%2Fmobile%2Fandroid%2Ftests%2Fbrowser%2Fchrome%2Fbasic_article_mobile.html";
|
||||
|
||||
function dispatchUIEvent(browser, type) {
|
||||
let event = browser.contentDocument.createEvent("UIEvents");
|
||||
event.initUIEvent(type, true, false, browser.contentDocument.defaultView, 0);
|
||||
browser.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function setScrollPosition(browser, x, y) {
|
||||
browser.contentWindow.scrollTo(x, y);
|
||||
dispatchUIEvent(browser, "scroll");
|
||||
}
|
||||
|
||||
function setZoomLevel(browser, zoom) {
|
||||
browser.contentWindow.QueryInterface(
|
||||
Ci.nsIInterfaceRequestor).getInterface(
|
||||
Ci.nsIDOMWindowUtils).setResolutionAndScaleTo(zoom);
|
||||
}
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
|
||||
add_task(function* test_sessionStoreScrollPosition() {
|
||||
const SCROLL_X = 0;
|
||||
const SCROLL_Y = 38;
|
||||
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Creates a tab, sets a scroll position and closes the tab.
|
||||
function createAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
tabScroll = BrowserApp.addTab(URL);
|
||||
let browser = tabScroll.browser;
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Modify scroll position.
|
||||
setScrollPosition(browser, SCROLL_X, SCROLL_Y);
|
||||
yield promiseTabEvent(browser, "SSTabScrollCaptured");
|
||||
|
||||
// Check that we've actually scrolled.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {};
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
is(scrollX.value, SCROLL_X, "scrollX set correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY set correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(tabScroll);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveTab();
|
||||
let state = ss.getClosedTabs(chromeWin);
|
||||
let [{scrolldata}] = state;
|
||||
is(scrolldata.scroll, SCROLL_X + "," + SCROLL_Y, "stored scroll position is correct");
|
||||
|
||||
// Restore the closed tab.
|
||||
let closedTabData = ss.getClosedTabs(chromeWin)[0];
|
||||
let browser = ss.undoCloseTab(chromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Check the scroll position.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {};
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
is(scrollX.value, SCROLL_X, "scrollX restored correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
add_task(function* test_sessionStoreScrollPositionReaderMode() {
|
||||
const SCROLL_X = 0;
|
||||
const SCROLL_Y = 44;
|
||||
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Creates a tab, sets a scroll position and closes the tab.
|
||||
function createAndRemoveReaderTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
tabScroll = BrowserApp.addTab(URL_reader);
|
||||
let browser = tabScroll.browser;
|
||||
yield promiseBrowserEvent(browser, "AboutReaderContentReady");
|
||||
|
||||
// Modify scroll position.
|
||||
setScrollPosition(browser, SCROLL_X, SCROLL_Y);
|
||||
yield promiseTabEvent(browser, "SSTabScrollCaptured");
|
||||
|
||||
// Check that we've actually scrolled.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {};
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
is(scrollX.value, SCROLL_X, "scrollX set correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY set correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(tabScroll);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveReaderTab();
|
||||
let state = ss.getClosedTabs(chromeWin);
|
||||
let [{scrolldata}] = state;
|
||||
is(scrolldata.scroll, SCROLL_X + "," + SCROLL_Y, "stored scroll position is correct");
|
||||
|
||||
// Restore the closed tab.
|
||||
let closedTabData = ss.getClosedTabs(chromeWin)[0];
|
||||
let browser = ss.undoCloseTab(chromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "AboutReaderContentReady");
|
||||
|
||||
// Check the scroll position.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {};
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
is(scrollX.value, SCROLL_X, "scrollX restored correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
add_task(function* test_sessionStoreZoomLevel() {
|
||||
const ZOOM = 4.2;
|
||||
const SCROLL_X = 42;
|
||||
const SCROLL_Y = 42;
|
||||
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Creates a tab, sets a scroll position and zoom level and closes the tab.
|
||||
function createAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
tabScroll = BrowserApp.addTab(URL);
|
||||
let browser = tabScroll.browser;
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Modify scroll position and zoom level.
|
||||
setZoomLevel(browser, ZOOM);
|
||||
setScrollPosition(browser, SCROLL_X, SCROLL_Y);
|
||||
yield promiseTabEvent(browser, "SSTabScrollCaptured");
|
||||
|
||||
// Check that we've actually scrolled and zoomed.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {}, zoom = {};
|
||||
utils.getResolution(zoom);
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
ok(fuzzyEquals(zoom.value, ZOOM), "zoom set correctly");
|
||||
is(scrollX.value, SCROLL_X, "scrollX set correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY set correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(tabScroll);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveTab();
|
||||
let state = ss.getClosedTabs(chromeWin);
|
||||
let [{scrolldata}] = state;
|
||||
is(scrolldata.scroll, SCROLL_X + "," + SCROLL_Y, "stored scroll position is correct");
|
||||
ok(fuzzyEquals(scrolldata.zoom.resolution, ZOOM), "stored zoom level is correct");
|
||||
|
||||
// Restore the closed tab.
|
||||
let closedTabData = ss.getClosedTabs(chromeWin)[0];
|
||||
let browser = ss.undoCloseTab(chromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Check the scroll position and zoom level.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {}, zoom = {};
|
||||
utils.getResolution(zoom);
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
ok(fuzzyEquals(zoom.value, ZOOM), "zoom restored correctly");
|
||||
is(scrollX.value, SCROLL_X, "scrollX restored correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
add_task(function* test_sessionStoreZoomLevelRecalc() {
|
||||
const ZOOM = 4.2;
|
||||
const SCROLL_X = 42;
|
||||
const SCROLL_Y = 42;
|
||||
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
// Creates a tab, sets a scroll position and zoom level and closes the tab.
|
||||
function createAndRemoveTab() {
|
||||
return Task.spawn(function () {
|
||||
// Create a new tab.
|
||||
tabScroll = BrowserApp.addTab(URL_desktop);
|
||||
let browser = tabScroll.browser;
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Modify scroll position and zoom level.
|
||||
setZoomLevel(browser, ZOOM);
|
||||
setScrollPosition(browser, SCROLL_X, SCROLL_Y);
|
||||
yield promiseTabEvent(browser, "SSTabScrollCaptured");
|
||||
|
||||
// Check that we've actually scrolled and zoomed.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {}, zoom = {};
|
||||
utils.getResolution(zoom);
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
ok(fuzzyEquals(zoom.value, ZOOM), "zoom set correctly");
|
||||
is(scrollX.value, SCROLL_X, "scrollX set correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY set correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(tabScroll);
|
||||
yield promiseTabEvent(browser, "SSTabCloseProcessed");
|
||||
});
|
||||
}
|
||||
|
||||
yield createAndRemoveTab();
|
||||
let state = ss.getClosedTabs(chromeWin);
|
||||
let [{scrolldata}] = state;
|
||||
is(scrolldata.scroll, SCROLL_X + "," + SCROLL_Y, "stored scroll position is correct");
|
||||
ok(fuzzyEquals(scrolldata.zoom.resolution, ZOOM), "stored zoom level is correct");
|
||||
|
||||
// Pretend the zoom level was originally saved on a rotated device.
|
||||
let closedTabData = ss.getClosedTabs(chromeWin)[0];
|
||||
let displayWidth = scrolldata.zoom.displaySize.width;
|
||||
let displayHeight = scrolldata.zoom.displaySize.height;
|
||||
closedTabData.scrolldata.zoom.displaySize.width = displayHeight;
|
||||
closedTabData.scrolldata.zoom.displaySize.height = displayWidth;
|
||||
|
||||
// Restore the closed tab.
|
||||
let browser = ss.undoCloseTab(chromeWin, closedTabData);
|
||||
yield promiseBrowserEvent(browser, "pageshow");
|
||||
|
||||
// Check the scroll position and zoom level.
|
||||
let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {}, zoom = {};
|
||||
utils.getResolution(zoom);
|
||||
utils.getScrollXY(false, scrollX, scrollY);
|
||||
ok(fuzzyEquals(zoom.value, ZOOM * displayWidth / displayHeight), "recalculated zoom restored correctly");
|
||||
is(scrollX.value, SCROLL_X, "scrollX restored correctly");
|
||||
is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
|
||||
|
||||
// Remove the tab.
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=810981">Mozilla Bug 810981</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1044556
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1044556</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 1044556 **/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
// Import the MemoryObserver
|
||||
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyGetter(this, "MemoryObserver", function() {
|
||||
let sandbox = {};
|
||||
Services.scriptloader.loadSubScript("chrome://browser/content/MemoryObserver.js", sandbox);
|
||||
return sandbox["MemoryObserver"];
|
||||
});
|
||||
|
||||
// The chrome window
|
||||
let chromeWin;
|
||||
|
||||
// Track the tabs where the tests are happening
|
||||
let tabBlank;
|
||||
let tabTest;
|
||||
|
||||
const url1 = "data:text/html;charset=utf-8,It%20was%20a%20dark%20and%20stormy%20night.";
|
||||
const url2 = "data:text/html;charset=utf-8,Suddenly%2C%20a%20tab%20was%20zombified.";
|
||||
|
||||
add_task(function* test_sessionStoreZombify() {
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
BrowserApp.closeTab(tabBlank);
|
||||
BrowserApp.closeTab(tabTest);
|
||||
});
|
||||
|
||||
// Add a new tab with some content
|
||||
tabTest = BrowserApp.addTab(url1 , { selected: true, parentId: BrowserApp.selectedTab.id });
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
|
||||
// Add a new tab with a blank page
|
||||
tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
|
||||
is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
|
||||
|
||||
// Zombify the backgrounded test tab
|
||||
MemoryObserver.zombify(tabTest);
|
||||
|
||||
// Check that the test tab is actually zombified
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
|
||||
|
||||
// Switch back to the test tab and wait for it to reload
|
||||
BrowserApp.selectTab(tabTest);
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
|
||||
// Check that the test tab has loaded the correct url
|
||||
is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the first URL.");
|
||||
|
||||
// Navigate to some other content
|
||||
BrowserApp.loadURI(url2, tabTest.browser);
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
is(tabTest.browser.currentURI.spec, url2, "Test tab is showing the second URL.");
|
||||
|
||||
// Switch to the other tab
|
||||
BrowserApp.selectTab(tabBlank);
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
|
||||
|
||||
// Zombify the backgrounded test tab again
|
||||
MemoryObserver.zombify(tabTest);
|
||||
|
||||
// Check that the test tab is actually zombified
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
|
||||
|
||||
// Switch back to the test tab and wait for it to reload
|
||||
BrowserApp.selectTab(tabTest);
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
|
||||
// Check that the test tab has loaded the correct url
|
||||
is(tabTest.browser.currentURI.spec, url2, "Test tab is showing the second URL.");
|
||||
});
|
||||
|
||||
add_task(function* test_sessionStoreKeepAsZombie() {
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
let observerService = Services.obs;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function() {
|
||||
BrowserApp.closeTab(tabBlank);
|
||||
BrowserApp.closeTab(tabTest);
|
||||
});
|
||||
|
||||
// Add a new tab with some content
|
||||
tabTest = BrowserApp.addTab(url1 , { selected: true, parentId: BrowserApp.selectedTab.id });
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
|
||||
// Add a new tab with a blank page
|
||||
tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
|
||||
|
||||
// Zombify the backgrounded test tab
|
||||
MemoryObserver.zombify(tabTest);
|
||||
|
||||
// Check that the test tab is actually zombified
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
|
||||
is(tabTest.browser.currentURI.spec, "about:blank", "Test tab is zombified.");
|
||||
|
||||
// Tell the session store that it shouldn't restore that tab on selecting
|
||||
observerService.notifyObservers(null, "Tab:KeepZombified", tabTest.id);
|
||||
|
||||
// Switch back to the test tab and check that it remains zombified
|
||||
BrowserApp.selectTab(tabTest);
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is still set for delay loading.");
|
||||
|
||||
// Switch to the other tab and back again
|
||||
BrowserApp.selectTab(tabBlank);
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
|
||||
BrowserApp.selectTab(tabTest);
|
||||
|
||||
// "Tab:KeepZombified should be good for one TabSelect only
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
|
||||
|
||||
// Check that the test tab is no longer a zombie and has loaded the correct url
|
||||
ok(!tabTest.browser.__SS_restore, "Test tab is no longer set for delay loading.");
|
||||
is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the test URL.");
|
||||
|
||||
// Zombify the test tab again
|
||||
BrowserApp.selectTab(tabBlank);
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
|
||||
MemoryObserver.zombify(tabTest);
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
|
||||
is(tabTest.browser.currentURI.spec, "about:blank", "Test tab is zombified.");
|
||||
|
||||
// Tell the session store that it shouldn't restore that tab on selecting
|
||||
observerService.notifyObservers(null, "Tab:KeepZombified", tabTest.id);
|
||||
|
||||
// Switch back to the test tab and check that it remains zombified
|
||||
BrowserApp.selectTab(tabTest);
|
||||
yield promiseTabEvent(BrowserApp.deck, "TabSelect");
|
||||
is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
|
||||
ok(tabTest.browser.__SS_restore, "Test tab is still set for delay loading.");
|
||||
|
||||
// Fake an "application-foreground" notification
|
||||
observerService.notifyObservers(null, "application-foreground", null);
|
||||
|
||||
// The test tab should now start reloading
|
||||
yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
|
||||
ok(!tabTest.browser.__SS_restore, "Test tab is no longer set for delay loading.");
|
||||
is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the test URL.");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1044556">Mozilla Bug 1044556</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
255
mobile/android/tests/browser/chrome/test_shared_preferences.html
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=866271
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 866271</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
Components.utils.import("resource://gre/modules/SharedPreferences.jsm");
|
||||
Components.utils.import("resource://gre/modules/Promise.jsm");
|
||||
Components.utils.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
let _observerId = 0;
|
||||
|
||||
function makeObserver() {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let ret = {
|
||||
id: _observerId++,
|
||||
count: 0,
|
||||
promise: deferred.promise,
|
||||
observe: function (subject, topic, data) {
|
||||
ret.count += 1;
|
||||
let msg = { subject: subject,
|
||||
topic: topic,
|
||||
data: data };
|
||||
deferred.resolve(msg);
|
||||
},
|
||||
};
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
add_task(function* test_get_set() {
|
||||
let branch = SharedPreferences.forAndroid("test");
|
||||
|
||||
branch.setBoolPref("boolKey", true);
|
||||
branch.setCharPref("charKey", "string value");
|
||||
branch.setIntPref("intKey", 1000);
|
||||
|
||||
is(branch.getBoolPref("boolKey"), true);
|
||||
is(branch.getCharPref("charKey"), "string value");
|
||||
is(branch.getIntPref("intKey"), 1000);
|
||||
|
||||
branch.setBoolPref("boolKey", false);
|
||||
branch.setCharPref("charKey", "different string value");
|
||||
branch.setIntPref("intKey", -2000);
|
||||
|
||||
is(branch.getBoolPref("boolKey"), false);
|
||||
is(branch.getCharPref("charKey"), "different string value");
|
||||
is(branch.getIntPref("intKey"), -2000);
|
||||
|
||||
is(typeof(branch.getBoolPref("boolKey")), "boolean");
|
||||
is(typeof(branch.getCharPref("charKey")), "string");
|
||||
is(typeof(branch.getIntPref("intKey")), "number");
|
||||
});
|
||||
|
||||
add_task(function* test_default() {
|
||||
let branch = SharedPreferences.forAndroid();
|
||||
|
||||
branch.setBoolPref("boolKey", true);
|
||||
branch.setCharPref("charKey", "string value");
|
||||
branch.setIntPref("intKey", 1000);
|
||||
|
||||
is(branch.getBoolPref("boolKey"), true);
|
||||
is(branch.getCharPref("charKey"), "string value");
|
||||
is(branch.getIntPref("intKey"), 1000);
|
||||
|
||||
branch.setBoolPref("boolKey", false);
|
||||
branch.setCharPref("charKey", "different string value");
|
||||
branch.setIntPref("intKey", -2000);
|
||||
|
||||
is(branch.getBoolPref("boolKey"), false);
|
||||
is(branch.getCharPref("charKey"), "different string value");
|
||||
is(branch.getIntPref("intKey"), -2000);
|
||||
|
||||
is(typeof(branch.getBoolPref("boolKey")), "boolean");
|
||||
is(typeof(branch.getCharPref("charKey")), "string");
|
||||
is(typeof(branch.getIntPref("intKey")), "number");
|
||||
});
|
||||
|
||||
add_task(function* test_multiple_branches() {
|
||||
let branch1 = SharedPreferences.forAndroid("test1");
|
||||
let branch2 = SharedPreferences.forAndroid("test2");
|
||||
|
||||
branch1.setBoolPref("boolKey", true);
|
||||
branch2.setBoolPref("boolKey", false);
|
||||
|
||||
is(branch1.getBoolPref("boolKey"), true);
|
||||
is(branch2.getBoolPref("boolKey"), false);
|
||||
|
||||
branch1.setCharPref("charKey", "a value");
|
||||
branch2.setCharPref("charKey", "a different value");
|
||||
|
||||
is(branch1.getCharPref("charKey"), "a value");
|
||||
is(branch2.getCharPref("charKey"), "a different value");
|
||||
});
|
||||
|
||||
add_task(function* test_add_remove_observer() {
|
||||
let branch = SharedPreferences.forAndroid("test");
|
||||
|
||||
branch.setBoolPref("boolKey", false);
|
||||
is(branch.getBoolPref("boolKey"), false);
|
||||
|
||||
let obs1 = makeObserver();
|
||||
branch.addObserver("boolKey", obs1);
|
||||
|
||||
try {
|
||||
branch.setBoolPref("boolKey", true);
|
||||
is(branch.getBoolPref("boolKey"), true);
|
||||
|
||||
let value1 = yield obs1.promise;
|
||||
is(obs1.count, 1);
|
||||
|
||||
is(value1.subject, obs1);
|
||||
is(value1.topic, "boolKey");
|
||||
is(typeof(value1.data), "boolean");
|
||||
is(value1.data, true);
|
||||
} finally {
|
||||
branch.removeObserver("boolKey", obs1);
|
||||
}
|
||||
|
||||
// Make sure the original observer is really gone, or as close as
|
||||
// we: install a second observer, wait for it to be notified, and
|
||||
// then verify the original observer was *not* notified. This
|
||||
// depends, of course, on the order that observers are notified, but
|
||||
// is better than nothing.
|
||||
|
||||
let obs2 = makeObserver();
|
||||
branch.addObserver("boolKey", obs2);
|
||||
|
||||
try {
|
||||
branch.setBoolPref("boolKey", false);
|
||||
is(branch.getBoolPref("boolKey"), false);
|
||||
|
||||
let value2 = yield obs2.promise;
|
||||
is(obs2.count, 1);
|
||||
|
||||
is(value2.subject, obs2);
|
||||
is(value2.topic, "boolKey");
|
||||
is(typeof(value2.data), "boolean");
|
||||
is(value2.data, false);
|
||||
|
||||
// Original observer count is preserved.
|
||||
is(obs1.count, 1);
|
||||
} finally {
|
||||
branch.removeObserver("boolKey", obs2);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_observer_ignores() {
|
||||
let branch = SharedPreferences.forAndroid("test");
|
||||
|
||||
branch.setCharPref("charKey", "first value");
|
||||
is(branch.getCharPref("charKey"), "first value");
|
||||
|
||||
let obs = makeObserver();
|
||||
branch.addObserver("charKey", obs);
|
||||
|
||||
try {
|
||||
// These should all be ignored.
|
||||
branch.setBoolPref("boolKey", true);
|
||||
branch.setBoolPref("boolKey", false);
|
||||
branch.setIntPref("intKey", -3000);
|
||||
branch.setIntPref("intKey", 4000);
|
||||
|
||||
branch.setCharPref("charKey", "a value");
|
||||
let value = yield obs.promise;
|
||||
|
||||
// Observer should have been notified exactly once.
|
||||
is(obs.count, 1);
|
||||
|
||||
is(value.subject, obs);
|
||||
is(value.topic, "charKey");
|
||||
is(typeof(value.data), "string");
|
||||
is(value.data, "a value");
|
||||
} finally {
|
||||
branch.removeObserver("charKey", obs);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_observer_ignores_branches() {
|
||||
let branch = SharedPreferences.forAndroid("test");
|
||||
|
||||
branch.setCharPref("charKey", "first value");
|
||||
is(branch.getCharPref("charKey"), "first value");
|
||||
|
||||
let obs = makeObserver();
|
||||
branch.addObserver("charKey", obs);
|
||||
|
||||
try {
|
||||
// These should all be ignored.
|
||||
let branch2 = SharedPreferences.forAndroid("test2");
|
||||
branch2.setCharPref("charKey", "a wrong value");
|
||||
let branch3 = SharedPreferences.forAndroid("test.2");
|
||||
branch3.setCharPref("charKey", "a different wrong value");
|
||||
|
||||
// This should not be ignored.
|
||||
branch.setCharPref("charKey", "a value");
|
||||
|
||||
let value = yield obs.promise;
|
||||
|
||||
// Observer should have been notified exactly once.
|
||||
is(obs.count, 1);
|
||||
|
||||
is(value.subject, obs);
|
||||
is(value.topic, "charKey");
|
||||
is(typeof(value.data), "string");
|
||||
is(value.data, "a value");
|
||||
} finally {
|
||||
branch.removeObserver("charKey", obs);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_scopes() {
|
||||
let forApp = SharedPreferences.forApp();
|
||||
let forProfile = SharedPreferences.forProfile();
|
||||
let forProfileName = SharedPreferences.forProfileName("testProfile");
|
||||
let forAndroidDefault = SharedPreferences.forAndroid();
|
||||
let forAndroidBranch = SharedPreferences.forAndroid("testBranch");
|
||||
|
||||
forApp.setCharPref("charKey", "forApp");
|
||||
forProfile.setCharPref("charKey", "forProfile");
|
||||
forProfileName.setCharPref("charKey", "forProfileName");
|
||||
forAndroidDefault.setCharPref("charKey", "forAndroidDefault");
|
||||
forAndroidBranch.setCharPref("charKey", "forAndroidBranch");
|
||||
|
||||
is(forApp.getCharPref("charKey"), "forApp");
|
||||
is(forProfile.getCharPref("charKey"), "forProfile");
|
||||
is(forProfileName.getCharPref("charKey"), "forProfileName");
|
||||
is(forAndroidDefault.getCharPref("charKey"), "forAndroidDefault");
|
||||
is(forAndroidBranch.getCharPref("charKey"), "forAndroidBranch");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=866271">Mozilla Bug 866271</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testSharedPreferences</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=938571
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 938571</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
/*globals SimpleServiceDiscovery */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
||||
|
||||
function discovery_observer(subject, topic, data) {
|
||||
dump("Observer: " + data);
|
||||
|
||||
let service = SimpleServiceDiscovery.findServiceForID(data);
|
||||
if (!service)
|
||||
return;
|
||||
|
||||
is(service.friendlyName, "Pretend Device");
|
||||
is(service.uuid, "uuid:5ec9ff92-e8b2-4a94-a72c-76b34e6dabb1");
|
||||
is(service.manufacturer, "Copy Cat Inc.");
|
||||
is(service.modelName, "Eureka Dongle");
|
||||
|
||||
SimpleTest.finish();
|
||||
};
|
||||
|
||||
var testDevice = {
|
||||
id: "test:dummy",
|
||||
target: "test:service",
|
||||
factory: function(service) { /* dummy */ },
|
||||
types: ["video/mp4"],
|
||||
extensions: ["mp4"]
|
||||
};
|
||||
|
||||
function test_default() {
|
||||
SimpleTest.registerCleanupFunction(function cleanup() {
|
||||
SimpleServiceDiscovery.unregisterDevice(testDevice);
|
||||
Services.obs.removeObserver(discovery_observer, "ssdp-service-found");
|
||||
});
|
||||
|
||||
Services.obs.addObserver(discovery_observer, "ssdp-service-found", false);
|
||||
|
||||
// We need to register a device or processService will ignore us
|
||||
SimpleServiceDiscovery.registerDevice(testDevice);
|
||||
|
||||
// Create a pretend service
|
||||
let service = {
|
||||
location: "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/simpleservice.xml",
|
||||
target: "test:service"
|
||||
};
|
||||
|
||||
dump("Force a detailed ping from a pretend service");
|
||||
|
||||
// Poke the service directly to get the discovery to happen
|
||||
SimpleServiceDiscovery._processService(service);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
test_default();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=938571">Mozilla Bug 938571</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testSimpleDiscovery</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
154
mobile/android/tests/browser/chrome/test_video_discovery.html
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=953381
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 953381</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
"use strict";
|
||||
|
||||
/*globals SimpleServiceDiscovery */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
||||
|
||||
// The chrome window
|
||||
let chromeWin;
|
||||
|
||||
// Track the <browser> where the tests are happening
|
||||
let browser;
|
||||
|
||||
function middle(element) {
|
||||
let rect = element.getBoundingClientRect();
|
||||
let x = (rect.right - rect.left) / 2 + rect.left;
|
||||
let y = (rect.bottom - rect.top) / 2 + rect.top;
|
||||
return [x, y];
|
||||
}
|
||||
|
||||
// We must register a device and make a "mock" service for the device
|
||||
var testDevice = {
|
||||
id: "test:dummy",
|
||||
target: "test:service",
|
||||
factory: function(service) { /* dummy */ },
|
||||
types: ["video/mp4", "video/webm"],
|
||||
extensions: ["mp4", "webm"]
|
||||
};
|
||||
|
||||
function setup_browser() {
|
||||
chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = chromeWin.BrowserApp;
|
||||
|
||||
SimpleTest.registerCleanupFunction(function cleanup() {
|
||||
BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
|
||||
SimpleServiceDiscovery.unregisterDevice(testDevice);
|
||||
});
|
||||
|
||||
// We need to register a device or processService will ignore us
|
||||
SimpleServiceDiscovery.registerDevice(testDevice);
|
||||
|
||||
// Create a pretend service
|
||||
let service = {
|
||||
location: "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/simpleservice.xml",
|
||||
target: "test:service"
|
||||
};
|
||||
|
||||
dump("Force a detailed ping from a pretend service");
|
||||
|
||||
// Poke the service directly to get the discovery to happen
|
||||
SimpleServiceDiscovery._processService(service);
|
||||
|
||||
// Load our test web page with <video> elements
|
||||
let url = "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_discovery.html";
|
||||
browser = BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
|
||||
browser.addEventListener("load", function startTests(event) {
|
||||
browser.removeEventListener("load", startTests, true);
|
||||
Services.tm.mainThread.dispatch(test_video, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
}, true);
|
||||
}
|
||||
|
||||
let videoDiscoveryTests = [
|
||||
{ id: "simple-mp4", source: "http://mochi.test:8888/simple.mp4", poster: "http://mochi.test:8888/simple.png", text: "simple video with mp4 src" },
|
||||
{ id: "simple-fail", pass: false, text: "simple video with no mp4 src" },
|
||||
{ id: "with-sources-mp4", source: "http://mochi.test:8888/simple.mp4", text: "video with mp4 extension source child" },
|
||||
{ id: "with-sources-webm", source: "http://mochi.test:8888/simple.webm", text: "video with webm extension source child" },
|
||||
{ id: "with-sources-fail", pass: false, text: "video with no mp4 extension source child" },
|
||||
{ id: "with-sources-mimetype-mp4", source: "http://mochi.test:8888/simple-video-mp4", text: "video with mp4 mimetype source child" },
|
||||
{ id: "with-sources-mimetype-webm", source: "http://mochi.test:8888/simple-video-webm", text: "video with webm mimetype source child" },
|
||||
{ id: "simple-fetch-pass", source: "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_discovery.sjs?type=video/mp4", text: "simple video with mp4 mimetype fetched from server" },
|
||||
{ id: "simple-fetch-fail", pass: false, text: "simple video with non-video mimetype fetched from server" },
|
||||
{ id: "video-overlay", source: "http://mochi.test:8888/simple.mp4", text: "div overlay covering a simple video with mp4 src" }
|
||||
];
|
||||
|
||||
let expectedTests = videoDiscoveryTests.length;
|
||||
|
||||
function execute_video_test(test) {
|
||||
let element = browser.contentDocument.getElementById(test.id);
|
||||
if (element) {
|
||||
let [x, y] = middle(element);
|
||||
dump("Starting to getVideo");
|
||||
chromeWin.CastingApps.getVideo(element, x, y, (video) => {
|
||||
dump("Completed getVideo");
|
||||
if (video) {
|
||||
dump("video source: " + video.source);
|
||||
|
||||
let matchPoster = (test.poster == video.poster);
|
||||
let matchSource = (test.source == video.source);
|
||||
ok(matchPoster && matchSource && test.pass, test.text);
|
||||
} else {
|
||||
ok(!test.pass, test.text);
|
||||
}
|
||||
expectedTests--;
|
||||
if (expectedTests == 0) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ok(false, "test element not found: [" + test.id + "]");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
function test_video() {
|
||||
let videoTest;
|
||||
while ((videoTest = videoDiscoveryTests.shift())) {
|
||||
if (!("poster" in videoTest)) {
|
||||
videoTest.poster = "";
|
||||
}
|
||||
if (!("pass" in videoTest)) {
|
||||
videoTest.pass = true;
|
||||
}
|
||||
execute_video_test(videoTest);
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// On debug runs, 10 assertions typically observed; 5 each of:
|
||||
// - ASSERTION: cancel with non-failure status code: 'NS_FAILED(status)'
|
||||
// - ASSERTION: OnDataAvailable implementation consumed no data: 'Error'
|
||||
SimpleTest.expectAssertions(0,10);
|
||||
setup_browser();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=953381">Mozilla Bug 953381</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testVideoDiscovery</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
121
mobile/android/tests/browser/chrome/test_web_channel.html
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1174458
|
||||
Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1174458</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components; /*global Components */
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm"); /*global Promise */
|
||||
Cu.import("resource://gre/modules/Services.jsm"); /*global Services */
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); /*global XPCOMUtils */
|
||||
Cu.import("resource://gre/modules/Task.jsm"); /*global Task */
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
|
||||
"resource://gre/modules/WebChannel.jsm"); /*global WebChannel */
|
||||
|
||||
const HTTP_PATH = "http://mochi.test:8888";
|
||||
const HTTP_ENDPOINT = "/chrome/mobile/android/tests/browser/chrome/web_channel.html";
|
||||
|
||||
const gChromeWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let BrowserApp = gChromeWin.BrowserApp;
|
||||
|
||||
// TODO: consider if we want to run the original test in browser-chrome instead
|
||||
|
||||
// Keep this synced with /browser/base/content/test/general/browser_web_channel.js
|
||||
// as much as possible. (We only have this since we can't run browser chrome
|
||||
// tests on Android. Yet?)
|
||||
let gTests = [
|
||||
{
|
||||
desc: "WebChannel generic message",
|
||||
run: function* () {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
|
||||
channel.listen(function (id, message, target) {
|
||||
is(id, "generic");
|
||||
is(message.something.nested, "hello");
|
||||
channel.stopListening();
|
||||
BrowserApp.closeTab(tab);
|
||||
resolve();
|
||||
});
|
||||
|
||||
tab = BrowserApp.addTab(HTTP_PATH + HTTP_ENDPOINT + "?generic");
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "WebChannel two way communication",
|
||||
run: function* () {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH, null, null));
|
||||
|
||||
channel.listen(function (id, message, sender) {
|
||||
is(id, "twoway");
|
||||
ok(message.command);
|
||||
|
||||
if (message.command === "one") {
|
||||
channel.send({ data: { nested: true } }, sender);
|
||||
}
|
||||
|
||||
if (message.command === "two") {
|
||||
is(message.detail.data.nested, true);
|
||||
channel.stopListening();
|
||||
BrowserApp.closeTab(tab);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
tab = BrowserApp.addTab(HTTP_PATH + HTTP_ENDPOINT + "?twoway");
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "WebChannel multichannel",
|
||||
run: function* () {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tab;
|
||||
let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH, null, null));
|
||||
|
||||
channel.listen(function (id, message, sender) {
|
||||
is(id, "multichannel");
|
||||
BrowserApp.closeTab(tab);
|
||||
resolve();
|
||||
});
|
||||
|
||||
tab = BrowserApp.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
|
||||
});
|
||||
}
|
||||
}
|
||||
]; // gTests
|
||||
|
||||
add_task(function* test() {
|
||||
for (let test of gTests) {
|
||||
info("Running: " + test.desc);
|
||||
yield test.run();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1174458">Mozilla Bug 1174458</a>
|
||||
<br>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testWebChannel</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 43 B |
|
|
@ -0,0 +1 @@
|
|||
var adrichend;
|
||||
|
|
@ -0,0 +1 @@
|
|||
a=1;
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=30417&FlightID=739&Values=1131919305&Redirect=http://l.163.com/indi/april.html"><img src="../img3.126.net/techpro/shangpin/20110331/36-65.jpg" border=0 height=65 width=360 alt=""></a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=33940&FlightID=740&Values=2875939796&Redirect=http://t.163.com/zt/2011"><img src="../img2.126.net/xoimages/sales/2011/04/wb/360x65.jpg" border=0 height=65 width=360 alt=""></a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=34355&FlightID=762&Values=868630560&Redirect=http://hr.163.com/hangzhou/"><img src="../img2.126.net/xoimages/hr/20110216/hz/360x100.jpg" border=0 height=100 width=360 alt=""></a>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33867&FlightID=747&Values=1741461550&Redirect=http://cps.mbaobao.com/cps/25892";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=360 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008995/mbb360100_110406.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008995/mbb360100_110406.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=360 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33867&FlightID=747&Values=1741461550&Redirect=http://cps.mbaobao.com/cps/25892" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008995/mbb360100_110406.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33867&FlightID=747&Values=1741461550&Redirect=http://cps.mbaobao.com/cps/25892" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/mbb360100_110406.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33867&FlightID=747&Values=1741461550&Redirect=http://cps.mbaobao.com/cps/25892" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/mbb360100_110406.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33925&FlightID=764&Values=3275702516&Redirect=http://a814.oadz.com/link/C/814/88700/Is4Y9DtmCqUv0pLFAc-xPJ0f8ts_/a/108/http://www.m18.com/market/front.aspx?pno=wan-gm-hp-00zty&url=/im";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=360 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008969/mai360100_110401.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008969/mai360100_110401.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=360 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33925&FlightID=764&Values=3275702516&Redirect=http://a814.oadz.com/link/C/814/88700/Is4Y9DtmCqUv0pLFAc-xPJ0f8ts_/a/108/http://www.m18.com/market/front.aspx?pno=wan-gm-hp-00zty&url=/im" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008969/mai360100_110401.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33925&FlightID=764&Values=3275702516&Redirect=http://a814.oadz.com/link/C/814/88700/Is4Y9DtmCqUv0pLFAc-xPJ0f8ts_/a/108/http://www.m18.com/market/front.aspx?pno=wan-gm-hp-00zty&url=/im" target="_blank"><IMG SRC="../img1.126.net/channel5/008969/mai360100_110401.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33925&FlightID=764&Values=3275702516&Redirect=http://a814.oadz.com/link/C/814/88700/Is4Y9DtmCqUv0pLFAc-xPJ0f8ts_/a/108/http://www.m18.com/market/front.aspx?pno=wan-gm-hp-00zty&url=/im" target="_blank"><IMG SRC="../img1.126.net/channel5/008969/mai360100_110401.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33914&FlightID=749&Values=1855147922&Redirect=http://a1419.oadz.com/link/C/1419/33/T3dnBK9qi69zlngdBjwKaRYj-ms_/a/2/http://www.topshoes.cn/";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=360 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008995/bl360100_110402.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008995/bl360100_110402.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=360 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33914&FlightID=749&Values=1855147922&Redirect=http://a1419.oadz.com/link/C/1419/33/T3dnBK9qi69zlngdBjwKaRYj-ms_/a/2/http://www.topshoes.cn/" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008995/bl360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33914&FlightID=749&Values=1855147922&Redirect=http://a1419.oadz.com/link/C/1419/33/T3dnBK9qi69zlngdBjwKaRYj-ms_/a/2/http://www.topshoes.cn/" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/bl360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33914&FlightID=749&Values=1855147922&Redirect=http://a1419.oadz.com/link/C/1419/33/T3dnBK9qi69zlngdBjwKaRYj-ms_/a/2/http://www.topshoes.cn/" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/bl360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33816&FlightID=766&Values=68259114&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1699&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=4";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=360 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008984/liangxie360100_110402.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008984/liangxie360100_110402.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=360 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33816&FlightID=766&Values=68259114&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1699&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=4" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008984/liangxie360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33816&FlightID=766&Values=68259114&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1699&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=4" target="_blank"><IMG SRC="../img1.126.net/channel5/008984/liangxie360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33816&FlightID=766&Values=68259114&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1699&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=4" target="_blank"><IMG SRC="../img1.126.net/channel5/008984/liangxie360100_110402.swf" WIDTH=360 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=34342&FlightID=761&Values=2612011559&Redirect=http://allyes.nie.163.com/main/adfclick?db=afanie&bid=38403,18618,355&cid=637,4,1&sid=37953&show=ignore&url=http://qn.163.com/yr/"><img src="../img2.126.net/xoimages/game/20110216/ql/x/390x100.jpg" border=0 height=100 width=390 alt=""></a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=34354&FlightID=744&Values=85863423&Redirect=http://travel.163.com/hellocity/"><img src="../img2.126.net/xoimages/sales/2011/03/ly/390x100.jpg" border=0 height=100 width=390 alt=""></a>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33814&FlightID=763&Values=3968994465&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1698&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=3";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=390 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008984/xizhuang390100_110402.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008984/xizhuang390100_110402.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=390 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33814&FlightID=763&Values=3968994465&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1698&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=3" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008984/xizhuang390100_110402.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33814&FlightID=763&Values=3968994465&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1698&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=3" target="_blank"><IMG SRC="../img1.126.net/channel5/008984/xizhuang390100_110402.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33814&FlightID=763&Values=3968994465&Redirect=http://click.moonbasa.com/transfer.aspx?cn=1698&type=0&adsiteid=10000007&url=http://www.moonbasa.com/?oid=3" target="_blank"><IMG SRC="../img1.126.net/channel5/008984/xizhuang390100_110402.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=34196&FlightID=745&Values=3301780629&Redirect=http://a1052.oadz.com/link/C/1052/39/TNCPMVEIYp-TRrZLJ27yq2NMhXs_/p032/6/http://www.olomo.com/position/?u=1894274&ompz=4454";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=390 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008995/ou390100_110408.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008995/ou390100_110408.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=390 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=34196&FlightID=745&Values=3301780629&Redirect=http://a1052.oadz.com/link/C/1052/39/TNCPMVEIYp-TRrZLJ27yq2NMhXs_/p032/6/http://www.olomo.com/position/?u=1894274&ompz=4454" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008995/ou390100_110408.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=34196&FlightID=745&Values=3301780629&Redirect=http://a1052.oadz.com/link/C/1052/39/TNCPMVEIYp-TRrZLJ27yq2NMhXs_/p032/6/http://www.olomo.com/position/?u=1894274&ompz=4454" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/ou390100_110408.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=34196&FlightID=745&Values=3301780629&Redirect=http://a1052.oadz.com/link/C/1052/39/TNCPMVEIYp-TRrZLJ27yq2NMhXs_/p032/6/http://www.olomo.com/position/?u=1894274&ompz=4454" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/ou390100_110408.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33871&FlightID=746&Values=478684510&Redirect=http://mso.allyes.com/main/c?db=mso&bid=63394,31657,2624&cid=62875,2992,149&sid=63319&show=ignore&url=http://www.vancl.com/?source=wy230703syzt5";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=390 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008977/5v390100_110406.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008977/5v390100_110406.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=390 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33871&FlightID=746&Values=478684510&Redirect=http://mso.allyes.com/main/c?db=mso&bid=63394,31657,2624&cid=62875,2992,149&sid=63319&show=ignore&url=http://www.vancl.com/?source=wy230703syzt5" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008977/5v390100_110406.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33871&FlightID=746&Values=478684510&Redirect=http://mso.allyes.com/main/c?db=mso&bid=63394,31657,2624&cid=62875,2992,149&sid=63319&show=ignore&url=http://www.vancl.com/?source=wy230703syzt5" target="_blank"><IMG SRC="../img1.126.net/channel5/008977/5v390100_110406.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33871&FlightID=746&Values=478684510&Redirect=http://mso.allyes.com/main/c?db=mso&bid=63394,31657,2624&cid=62875,2992,149&sid=63319&show=ignore&url=http://www.vancl.com/?source=wy230703syzt5" target="_blank"><IMG SRC="../img1.126.net/channel5/008977/5v390100_110406.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33888&FlightID=765&Values=2426328330&Redirect=http://a777.oadz.com/link/C/777/2972/Z6nbl6URgyAsEQVVzZ5skDUHOQ0_/a/126/http://www.fuocoo.com";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=390 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008995/fk390100_110331.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008995/fk390100_110331.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=390 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33888&FlightID=765&Values=2426328330&Redirect=http://a777.oadz.com/link/C/777/2972/Z6nbl6URgyAsEQVVzZ5skDUHOQ0_/a/126/http://www.fuocoo.com" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008995/fk390100_110331.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33888&FlightID=765&Values=2426328330&Redirect=http://a777.oadz.com/link/C/777/2972/Z6nbl6URgyAsEQVVzZ5skDUHOQ0_/a/126/http://www.fuocoo.com" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/fk390100_110331.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33888&FlightID=765&Values=2426328330&Redirect=http://a777.oadz.com/link/C/777/2972/Z6nbl6URgyAsEQVVzZ5skDUHOQ0_/a/126/http://www.fuocoo.com" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/fk390100_110331.swf" WIDTH=390 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=33904&FlightID=21&Values=1257549911&Redirect=http://allyes.nie.163.com/main/adfclick?db=afanie&bid=38403,18618,355&cid=637,4,1&sid=37953&show=ignore&url=http://qn.163.com/yr/"><img src="../img2.126.net/xoimages/game/20110216/ql/x/600x80.gif" border=0 height=80 width=600 alt=""></a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=34413&FlightID=750&Values=4252749124&Redirect=http://media.163.com/11/0407/12/711MA88S00762H91.html"><img src="../img2.126.net/xoimages/sales/2011/04/hy/190x100.jpg" border=0 height=100 width=190 alt=""></a>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33896&FlightID=751&Values=2829007648&Redirect=http://www.k121.com/?from=163w2";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=190 HEIGHT=100>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008981/kyd2_190100_110402.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008981/kyd2_190100_110402.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=190 HEIGHT=100');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33896&FlightID=751&Values=2829007648&Redirect=http://www.k121.com/?from=163w2" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008981/kyd2_190100_110402.swf" WIDTH=190 HEIGHT=100 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33896&FlightID=751&Values=2829007648&Redirect=http://www.k121.com/?from=163w2" target="_blank"><IMG SRC="../img1.126.net/channel5/008981/kyd2_190100_110402.swf" WIDTH=190 HEIGHT=100 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33896&FlightID=751&Values=2829007648&Redirect=http://www.k121.com/?from=163w2" target="_blank"><IMG SRC="../img1.126.net/channel5/008981/kyd2_190100_110402.swf" WIDTH=190 HEIGHT=100 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33829&FlightID=752&Values=2077038183&Redirect=http://nimafa7.allyes.com/main/c?db=nimafa7&bid=17117,7729,378&cid=6808,162,1&sid=17997&show=ignore&url=http://minisite.163.com/2011/0214/tries/";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=190 HEIGHT=180>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/009400/caizi190180_110408.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/009400/caizi190180_110408.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=190 HEIGHT=180');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33829&FlightID=752&Values=2077038183&Redirect=http://nimafa7.allyes.com/main/c?db=nimafa7&bid=17117,7729,378&cid=6808,162,1&sid=17997&show=ignore&url=http://minisite.163.com/2011/0214/tries/" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/009400/caizi190180_110408.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33829&FlightID=752&Values=2077038183&Redirect=http://nimafa7.allyes.com/main/c?db=nimafa7&bid=17117,7729,378&cid=6808,162,1&sid=17997&show=ignore&url=http://minisite.163.com/2011/0214/tries/" target="_blank"><IMG SRC="../img1.126.net/channel5/009400/caizi190180_110408.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33829&FlightID=752&Values=2077038183&Redirect=http://nimafa7.allyes.com/main/c?db=nimafa7&bid=17117,7729,378&cid=6808,162,1&sid=17997&show=ignore&url=http://minisite.163.com/2011/0214/tries/" target="_blank"><IMG SRC="../img1.126.net/channel5/009400/caizi190180_110408.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="httpdisabled://g.163.com/c?AID=34156&FlightID=753&Values=2278629106&Redirect=http://cidian.youdao.com/pingtian/"><img src="../img2.126.net/xoimages/sales/2011/04/yd/190x180.jpg" border=0 height=180 width=190 alt=""></a>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33920&FlightID=754&Values=743829921&Redirect=http://www.voidg.com/voidg2/lp/voidg/voidg.php?CID=CN_DIS_121_3_1_700";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=190 HEIGHT=180>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008995/voidg190180_110407.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008995/voidg190180_110407.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=190 HEIGHT=180');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33920&FlightID=754&Values=743829921&Redirect=http://www.voidg.com/voidg2/lp/voidg/voidg.php?CID=CN_DIS_121_3_1_700" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008995/voidg190180_110407.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33920&FlightID=754&Values=743829921&Redirect=http://www.voidg.com/voidg2/lp/voidg/voidg.php?CID=CN_DIS_121_3_1_700" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/voidg190180_110407.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33920&FlightID=754&Values=743829921&Redirect=http://www.voidg.com/voidg2/lp/voidg/voidg.php?CID=CN_DIS_121_3_1_700" target="_blank"><IMG SRC="../img1.126.net/channel5/008995/voidg190180_110407.swf" WIDTH=190 HEIGHT=180 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<script type='text/javascript' src='../zjs.ipinyou.com/2011032517331513260_2342_190180.js'></script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!-- Sniffer Code for Flash version=80 -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<SCRIPT LANGUAGE=JavaScript>
|
||||
<!--
|
||||
var swf_click = "httpdisabled://g.163.com/c?AID=33876&FlightID=756&Values=3536047884&Redirect=http://a814.oadz.com/link/C/814/88637/UoFr9DZA7GBQz2OagEiruxYJZCc_/a/108/http://www.m18.com/market/front.aspx?pno=wan-hp-s1&url=/im";
|
||||
var dcswf_click = escape(swf_click);
|
||||
var ShockMode = 0;
|
||||
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
|
||||
|
||||
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8)
|
||||
{
|
||||
ShockMode = 1;
|
||||
}
|
||||
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
|
||||
&& navigator.userAgent.indexOf("Opera")<0) {
|
||||
void('<SCRIPT LANGUAGE=VBScript\> \n');
|
||||
void('on error resume next \n');
|
||||
void('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
|
||||
void('<\/SCRIPT\> \n');
|
||||
}
|
||||
if ( ShockMode ) {
|
||||
void('<objectdisabled classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
|
||||
void(' codebase="httpdisabled://downloaddisabled.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
|
||||
void(' ID=flashad WIDTH=190 HEIGHT=300>');
|
||||
void(' <PARAM NAME=movie VALUE="httpdisabled://img1.126.net/channel5/008981/190300a_110406.swf?clickTag='+dcswf_click+'"> ');
|
||||
void(' <PARAM NAME=quality VALUE=autohigh> ');
|
||||
void(' <PARAM NAME=wmode VALUE=opaque> ');
|
||||
void(' <embeddisabled SRC="httpdisabled://img1.126.net/channel5/008981/190300a_110406.swf?clickTag='+dcswf_click+'" QUALITY=autohigh wmode=opaque');
|
||||
void(' NAME=flashad swLiveConnect=TRUE WIDTH=190 HEIGHT=300');
|
||||
void(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="httpdisabled://www.macromedia.com/shockwave/downloaddisabled/index.cgi?P1_Prod_Version=ShockwaveFlash">');
|
||||
void('</EMBED>');
|
||||
void('</OBJECT>');
|
||||
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
|
||||
void('<A HREF="httpdisabled://g.163.com/c?AID=33876&FlightID=756&Values=3536047884&Redirect=http://a814.oadz.com/link/C/814/88637/UoFr9DZA7GBQz2OagEiruxYJZCc_/a/108/http://www.m18.com/market/front.aspx?pno=wan-hp-s1&url=/im" target="_blank"><IMG SRC="httpdisabled://img1.126.net/channel5/008981/190300a_110406.swf" WIDTH=190 HEIGHT=300 BORDER=0></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOEMBED>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33876&FlightID=756&Values=3536047884&Redirect=http://a814.oadz.com/link/C/814/88637/UoFr9DZA7GBQz2OagEiruxYJZCc_/a/108/http://www.m18.com/market/front.aspx?pno=wan-hp-s1&url=/im" target="_blank"><IMG SRC="../img1.126.net/channel5/008981/190300a_110406.swf" WIDTH=190 HEIGHT=300 BORDER=0></A>
|
||||
</NOEMBED>
|
||||
<NOSCRIPT>
|
||||
<A HREF="httpdisabled://g.163.com/c?AID=33876&FlightID=756&Values=3536047884&Redirect=http://a814.oadz.com/link/C/814/88637/UoFr9DZA7GBQz2OagEiruxYJZCc_/a/108/http://www.m18.com/market/front.aspx?pno=wan-hp-s1&url=/im" target="_blank"><IMG SRC="../img1.126.net/channel5/008981/190300a_110406.swf" WIDTH=190 HEIGHT=300 BORDER=0></A>
|
||||
</NOSCRIPT>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<html><head></head><body></body></html>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<style>
|
||||
body {background:#fff; font-size:12px;}
|
||||
a,a:visited {float:left;line-height:21px;overflow:hidden;width:120px;color:#1E50A2;text-decoration:none;}
|
||||
a:hover {color:#ba2636;}
|
||||
</style>
|
||||
<script type="text/javascript" src="../img3.126.net/rpic/fld3/flsclasses.js"></script>
|
||||
<script type="text/javascript" src="../img3.126.net/rpic/fld3/fld_homepage.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if(typeof(qita)!=='undefined'){
|
||||
var prov=qita;
|
||||
echoa();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<style>
|
||||
body {background:#fff; font-size:12px;}
|
||||
a,a:visited {float:left;line-height:21px;overflow:hidden;width:120px;color:#1E50A2;text-decoration:none;}
|
||||
a:hover {color:#ba2636;}
|
||||
</style>
|
||||
<script type="text/javascript" src="../img3.126.net/rpic/fld3/flsclasses.js"></script>
|
||||
<script type="text/javascript" src="../img3.126.net/rpic/fld3/fld_homepage.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if(typeof(qita)!=='undefined'){
|
||||
var prov=qita;
|
||||
echob();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 501 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 579 B |
|
After Width: | Height: | Size: 930 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 1.7 KiB |