From ab6adf9ae674bcafe674580b618a7506f9e37825 Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Sat, 12 Nov 2011 20:19:06 -0800 Subject: [PATCH] fixed tests for new relay frame name-passing by tweaking mocks and making sure channel uses 'win' instead of 'window' so that mocks can be substituted in properly --- resources/static/dialog/resources/channel.js | 2 +- resources/static/test/qunit/resources/channel_unit_test.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/static/dialog/resources/channel.js b/resources/static/dialog/resources/channel.js index 04cdd2b78..68caa5235 100644 --- a/resources/static/dialog/resources/channel.js +++ b/resources/static/dialog/resources/channel.js @@ -57,7 +57,7 @@ onCompleteCallback; function getRelayName() { - return window.localStorage.RELAYFRAME_NAME; + return win.localStorage.RELAYFRAME_NAME; } function getRelayWindow() { diff --git a/resources/static/test/qunit/resources/channel_unit_test.js b/resources/static/test/qunit/resources/channel_unit_test.js index cd9621638..e5c26c079 100644 --- a/resources/static/test/qunit/resources/channel_unit_test.js +++ b/resources/static/test/qunit/resources/channel_unit_test.js @@ -44,7 +44,10 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/channel", func // Mock in the window object as well as the frame relay var winMock = { location: { - href: "browserid.org/sign_in#1234" + href: "browserid.org/sign_in" + }, + localStorage: { + RELAYFRAME_NAME : "browserid_relay_1234" }, opener: { frames: { -- GitLab