Bug 1059007 - Don't skip MozStorageChanged event for frames in session store (r=ttaubert)

This commit is contained in:
Bill McCloskey 2014-09-23 15:48:53 -07:00
Родитель 5acbba65ce
Коммит 22dcee9a12
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -60,7 +60,7 @@ function createLazy(fn) {
*/
function isSessionStorageEvent(event) {
try {
return event.storageArea == content.sessionStorage;
return event.storageArea == event.target.sessionStorage;
} catch (ex if ex instanceof Ci.nsIException && ex.result == Cr.NS_ERROR_NOT_AVAILABLE) {
// This page does not have a DOMSessionStorage
// (this is typically the case for about: pages)

Просмотреть файл

@ -29,7 +29,17 @@ add_task(function session_storage() {
is(storage["http://mochi.test:8888"].test, OUTER_VALUE,
"sessionStorage data for mochi.test has been serialized correctly");
// Ensure that modifying sessionStore values works.
// Ensure that modifying sessionStore values works for the inner frame only.
yield modifySessionStorage2(browser, {test: "modified1"});
TabState.flush(browser);
({storage} = JSON.parse(ss.getTabState(tab)));
is(storage["http://example.com"].test, "modified1",
"sessionStorage data for example.com has been serialized correctly");
is(storage["http://mochi.test:8888"].test, OUTER_VALUE,
"sessionStorage data for mochi.test has been serialized correctly");
// Ensure that modifying sessionStore values works for both frames.
yield modifySessionStorage(browser, {test: "modified"});
yield modifySessionStorage2(browser, {test: "modified2"});
TabState.flush(browser);