summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
committerMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
commiteda567b364a06e9e63efb865a6b1c73f1cb5232e (patch)
tree912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
parent80eb356d57fc310cdf812cae63de30d6e56c1788 (diff)
downloadUXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.gz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.lz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.xz
UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.zip
[AllAM] Remove Mozilla Tests
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js')
-rw-r--r--toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js86
1 files changed, 0 insertions, 86 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
deleted file mode 100644
index c252e1ced..000000000
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// This verifies that if the AMO response provides total_results,
-// searchSucceeded is called with the correct number of total results
-
-Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm");
-
-const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";
-
-Components.utils.import("resource://testing-common/httpd.js");
-var server;
-
-var TESTS = [
-{
- query: "bug554133",
- maxResults: 2,
- length: 2,
- total: 100
-},
-{
- query: "bug554133",
- maxResults: 10,
- length: 10,
- total: 100
-},
-{
- query: "bug554133",
- maxResults: 100,
- length: 10,
- total: 100
-}
-];
-
-var gCurrentTest = 0;
-var SearchCallback = {
- searchSucceeded: function(addons, length, total) {
- do_check_false(AddonRepository.isSearching);
- do_check_eq(addons.length, length);
- do_check_eq(length, TESTS[gCurrentTest].length);
- do_check_eq(total, TESTS[gCurrentTest].total);
-
- gCurrentTest++;
- run_current_test();
- },
-
- searchFailed: function() {
- server.stop(do_test_finished);
- do_throw("Search results failed");
- }
-};
-
-function run_current_test() {
- if (gCurrentTest < TESTS.length) {
- var query = TESTS[gCurrentTest].query;
- var maxResults = TESTS[gCurrentTest].maxResults;
- AddonRepository.searchAddons(query, maxResults, SearchCallback);
- }
- else
- server.stop(do_test_finished);
-}
-
-function run_test()
-{
- // Setup for test
- do_test_pending();
- createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
- startupManager();
-
- server = new HttpServer();
- server.registerDirectory("/", do_get_file("data"));
- mapFile("/data/test_bug554133.xml", server);
- server.start(-1);
- gPort = server.identity.primaryPort;
-
- // Point search to the test server
- Services.prefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS,
- "http://localhost:" + gPort + "/data/test_%TERMS%.xml");
-
- do_check_neq(AddonRepository, null);
- gCurrentTest = 0;
- run_current_test();
-}
-