Bug 1370454 - Part1: remove dup test in test_cookie_async_failure.js, r=mak
authorJunior Hsu <juhsu@mozilla.com>
Tue, 06 Jun 2017 12:06:02 +0800
changeset 411363 2ae4d9b0f74c0e0d3bdc8d3e5e70706db713d52a
parent 411362 24ef2aa69cf3366dc9efec033cba4bf61b6322f6
child 411364 94df53e8cc7eefbd20cd999a2e89f91b7083fd2b
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1370454
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1370454 - Part1: remove dup test in test_cookie_async_failure.js, r=mak
extensions/cookie/test/unit/test_cookies_async_failure.js
--- a/extensions/cookie/test/unit/test_cookies_async_failure.js
+++ b/extensions/cookie/test/unit/test_cookies_async_failure.js
@@ -403,84 +403,16 @@ function* run_test_4(generator)
   // Wait for the asynchronous read to choke and the insert to fail shortly
   // thereafter, at which point the backup file will be created and the database
   // rebuilt.
   new _observer(sub_generator, "cookie-db-rebuilding");
   yield;
   do_execute_soon(function() { do_run_generator(sub_generator); });
   yield;
 
-  // Close the profile.
-  do_close_profile(sub_generator);
-  yield;
-
-  // Check that the original database was renamed.
-  do_check_true(do_get_backup_file(profile).exists());
-  do_check_eq(do_get_backup_file(profile).fileSize, size);
-  let db = Services.storage.openDatabase(do_get_cookie_file(profile));
-  do_check_eq(do_count_cookies_in_db(db, "0.com"), 2);
-  db.close();
-
-  // Load the profile, and check that it contains the new cookie.
-  do_load_profile();
-  do_check_eq(Services.cookiemgr.countCookiesFromHost("0.com"), 2);
-  do_check_eq(do_count_cookies(), 2);
-
-  // Close the profile.
-  do_close_profile(sub_generator);
-  yield;
-
-  // Clean up.
-  do_get_cookie_file(profile).remove(false);
-  do_get_backup_file(profile).remove(false);
-  do_check_false(do_get_cookie_file(profile).exists());
-  do_check_false(do_get_backup_file(profile).exists());
-  do_run_generator(generator);
-}
-
-function* run_test_4(generator)
-{
-  // Load the profile and populate it.
-  do_load_profile();
-  for (let i = 0; i < 3000; ++i) {
-    let uri = NetUtil.newURI("http://" + i + ".com/");
-    Services.cookies.setCookieString(uri, null, "oh=hai; max-age=1000", null);
-  }
-
-  // Close the profile.
-  do_close_profile(sub_generator);
-  yield;
-
-  // Corrupt the database file.
-  let size = do_corrupt_db(do_get_cookie_file(profile));
-
-  // Load the profile.
-  do_load_profile();
-
-  // At this point, the database connection should be open. Ensure that it
-  // succeeded.
-  do_check_false(do_get_backup_file(profile).exists());
-
-  // Synchronously read in the first cookie. This will cause it to go into the
-  // cookie table, whereupon it will be written out during database rebuild.
-  do_check_eq(Services.cookiemgr.countCookiesFromHost("0.com"), 1);
-
-  // Queue up an INSERT for the same base domain. This should also go into
-  // memory and be written out during database rebuild.
-  let uri = NetUtil.newURI("http://0.com/");
-  Services.cookies.setCookieString(uri, null, "oh2=hai; max-age=1000", null);
-
-  // Wait for the asynchronous read to choke and the insert to fail shortly
-  // thereafter, at which point the backup file will be created and the database
-  // rebuilt.
-  new _observer(sub_generator, "cookie-db-rebuilding");
-  yield;
-  do_execute_soon(function() { do_run_generator(sub_generator); });
-  yield;
-
   // At this point, the cookies should still be in memory.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("0.com"), 2);
   do_check_eq(do_count_cookies(), 2);
 
   // Close the profile.
   do_close_profile(sub_generator);
   yield;