Revision b4cd33ad178aa280fc59395236b0c9f55104ac5d authored by kritisingh1 on 25 March 2018, 09:18:50 UTC, committed by kritisingh1 on 25 March 2018, 09:23:51 UTC
1 parent d04a8fc
Raw File
cookieStore_get_set_basic.tentative.window.js
'use strict';

// Workaround because add_cleanup doesn't support async functions yet.
// See https://github.com/w3c/web-platform-tests/issues/6075
async function async_cleanup(cleanup_function) {
  try {
    await cleanup_function();
  } catch (e) {
    // Errors in cleanup functions shouldn't result in test failures.
  }
}

promise_test(async testCase => {
  await cookieStore.set('cookie-name', 'cookie-value');
  const cookie = await cookieStore.get('cookie-name');

  assert_equals(cookie.name, 'cookie-name');
  assert_equals(cookie.value, 'cookie-value');

  await async_cleanup(() => cookieStore.delete('cookie-name'));
}, 'cookieStore.get returns the cookie written by cookieStore.set');
back to top