Bug 1338253 - Remove remaining legacy generator from extensions/cookie/test/. r=jdm

This commit is contained in:
Tooru Fujisawa 2017-02-11 11:47:57 +09:00
parent 746c9596d6
commit 4529253bd3
19 changed files with 41 additions and 42 deletions

View File

@ -42,7 +42,6 @@ function do_run_generator(generator)
try {
generator.next();
} catch (e) {
if (e != StopIteration)
do_throw("caught exception " + e, Components.stack.caller);
}
}
@ -51,7 +50,7 @@ function do_run_generator(generator)
function do_finish_generator_test(generator)
{
do_execute_soon(function() {
generator.close();
generator.return();
do_test_finished();
});
}

View File

@ -27,12 +27,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
this.profile = do_get_profile();
@ -118,7 +118,7 @@ function do_corrupt_db(file)
return size;
}
function run_test_1(generator)
function* run_test_1(generator)
{
// Load the profile and populate it.
let uri = NetUtil.newURI("http://foo.com/");
@ -207,7 +207,7 @@ function run_test_1(generator)
do_run_generator(generator);
}
function run_test_2(generator)
function* run_test_2(generator)
{
// Load the profile and populate it.
do_load_profile();
@ -273,7 +273,7 @@ function run_test_2(generator)
do_run_generator(generator);
}
function run_test_3(generator)
function* run_test_3(generator)
{
// Set the maximum cookies per base domain limit to a large value, so that
// corrupting the database is easier.
@ -368,7 +368,7 @@ function run_test_3(generator)
do_run_generator(generator);
}
function run_test_4(generator)
function* run_test_4(generator)
{
// Load the profile and populate it.
do_load_profile();
@ -436,7 +436,7 @@ function run_test_4(generator)
do_run_generator(generator);
}
function run_test_4(generator)
function* run_test_4(generator)
{
// Load the profile and populate it.
do_load_profile();
@ -508,7 +508,7 @@ function run_test_4(generator)
do_run_generator(generator);
}
function run_test_5(generator)
function* run_test_5(generator)
{
// Load the profile and populate it.
do_load_profile();

View File

@ -14,12 +14,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -12,7 +12,7 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
@ -22,7 +22,7 @@ function make_channel(url) {
.QueryInterface(Ci.nsIHttpChannel);
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -12,12 +12,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -14,12 +14,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -29,12 +29,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
this.profile = do_get_profile();
@ -136,7 +136,7 @@ function check_garbage_file(file)
do_check_false(file.exists());
}
function run_test_1(generator)
function* run_test_1(generator)
{
// Create a garbage database file.
create_garbage_file(cookieFile);
@ -165,7 +165,7 @@ function run_test_1(generator)
do_run_generator(generator);
}
function run_test_2(generator)
function* run_test_2(generator)
{
// Load the profile and populate it.
do_load_profile();
@ -196,7 +196,7 @@ function run_test_2(generator)
do_run_generator(generator);
}
function run_test_3(generator, schema)
function* run_test_3(generator, schema)
{
// Manually create a schema 2 database, populate it, and set the schema
// version to the desired number.
@ -224,7 +224,7 @@ function run_test_3(generator, schema)
do_run_generator(generator);
}
function run_test_4_exists(generator, schema, stmt)
function* run_test_4_exists(generator, schema, stmt)
{
// Manually create a database, populate it, and add the desired column.
let db = new CookieDatabaseConnection(do_get_cookie_file(profile), schema);
@ -254,7 +254,7 @@ function run_test_4_exists(generator, schema, stmt)
do_run_generator(generator);
}
function run_test_4_baseDomain(generator)
function* run_test_4_baseDomain(generator)
{
// Manually create a database and populate it with a bad host.
let db = new CookieDatabaseConnection(do_get_cookie_file(profile), 2);

View File

@ -14,12 +14,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -17,7 +17,7 @@ function continue_test()
do_run_generator(test_generator);
}
function do_run_test()
function* do_run_test()
{
// Set the base domain limit to 50 so we have a known value.
Services.prefs.setIntPref("network.cookie.maxPerHost", 50);

View File

@ -26,7 +26,7 @@ function repeat_test()
gShortExpiry *= 2;
do_execute_soon(function() {
test_generator.close();
test_generator.return();
test_generator = do_run_test();
do_run_generator(test_generator);
});
@ -53,7 +53,7 @@ function get_expiry_delay()
return gShortExpiry * 1000 + 100;
}
function do_run_test()
function* do_run_test()
{
// Set up a profile.
let profile = do_get_profile();

View File

@ -15,7 +15,7 @@ function continue_test()
do_run_generator(test_generator);
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -17,7 +17,7 @@ function run_test() {
run_next_test();
}
add_task(function test() {
add_task(function* test() {
/* Create and set up the permissions database */
let profile = do_get_profile();

View File

@ -17,7 +17,7 @@ function run_test() {
run_next_test();
}
add_task(function test() {
add_task(function* test() {
/* Create and set up the permissions database */
let profile = do_get_profile();

View File

@ -17,7 +17,7 @@ function run_test() {
run_next_test();
}
add_task(function test() {
add_task(function* test() {
/* Create and set up the permissions database */
let profile = do_get_profile();

View File

@ -17,7 +17,7 @@ function run_test() {
run_next_test();
}
add_task(function test() {
add_task(function* test() {
/* Create and set up the permissions database */
let profile = do_get_profile();

View File

@ -16,7 +16,7 @@ function continue_test()
do_run_generator(test_generator);
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -15,7 +15,7 @@ function continue_test()
do_run_generator(test_generator);
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -13,12 +13,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();

View File

@ -13,12 +13,12 @@ function run_test() {
function finish_test() {
do_execute_soon(function() {
test_generator.close();
test_generator.return();
do_test_finished();
});
}
function do_run_test() {
function* do_run_test() {
// Set up a profile.
let profile = do_get_profile();