From 301a37eb71f7228a4c468c034e4bc275d7b7d454 Mon Sep 17 00:00:00 2001 From: Joe Drew Date: Thu, 30 Jun 2011 21:58:36 -0400 Subject: [PATCH] Bug 552605 - Write tests to make sure we reload images that are redirected with a Cache-Control: no-cache header. r=bz --- docshell/test/chrome/89419.html | 7 ++ docshell/test/chrome/Makefile.in | 6 ++ docshell/test/chrome/blue.png | Bin 0 -> 2745 bytes docshell/test/chrome/bug89419.sjs | 13 +++ docshell/test/chrome/bug89419_window.xul | 76 ++++++++++++++++++ docshell/test/chrome/red.png | Bin 0 -> 82 bytes docshell/test/chrome/test_bug89419.xul | 43 ++++++++++ modules/libpr0n/test/mochitest/Makefile.in | 4 + .../test/mochitest/bug89419-iframe.html | 7 ++ modules/libpr0n/test/mochitest/bug89419.sjs | 13 +++ .../test/mochitest/test_bug89419-1.html | 68 ++++++++++++++++ .../test/mochitest/test_bug89419-2.html | 68 ++++++++++++++++ .../tests/SimpleTest/WindowSnapshot.js | 2 +- 13 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 docshell/test/chrome/89419.html create mode 100644 docshell/test/chrome/blue.png create mode 100644 docshell/test/chrome/bug89419.sjs create mode 100644 docshell/test/chrome/bug89419_window.xul create mode 100644 docshell/test/chrome/red.png create mode 100644 docshell/test/chrome/test_bug89419.xul create mode 100644 modules/libpr0n/test/mochitest/bug89419-iframe.html create mode 100644 modules/libpr0n/test/mochitest/bug89419.sjs create mode 100644 modules/libpr0n/test/mochitest/test_bug89419-1.html create mode 100644 modules/libpr0n/test/mochitest/test_bug89419-2.html diff --git a/docshell/test/chrome/89419.html b/docshell/test/chrome/89419.html new file mode 100644 index 00000000000..b36b8d788cf --- /dev/null +++ b/docshell/test/chrome/89419.html @@ -0,0 +1,7 @@ + + +Bug 89419 + + + + diff --git a/docshell/test/chrome/Makefile.in b/docshell/test/chrome/Makefile.in index 8888d772aa9..825e6598ad9 100644 --- a/docshell/test/chrome/Makefile.in +++ b/docshell/test/chrome/Makefile.in @@ -44,6 +44,9 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk _HTTP_FILES = \ + bug89419.sjs \ + blue.png \ + red.png \ 92598_nostore.html \ 92598_nostore.html^headers^ \ 112564_nocache.html \ @@ -58,6 +61,9 @@ _HTTP_FILES = \ $(NULL) _TEST_FILES = \ + test_bug89419.xul \ + bug89419_window.xul \ + 89419.html \ test_bug92598.xul \ bug92598_window.xul \ 92598_nostore.html \ diff --git a/docshell/test/chrome/blue.png b/docshell/test/chrome/blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8df58f3a5fc71ed2fc8d76cbe4e2629527b8292f GIT binary patch literal 2745 zcmV;q3P$ybP)4Tx02tGqk9Sy8X%@!6dvAK7B}6)xUPF}-K%|5! zAVs<;#3Vo{A%p}JyCN#6C@RtvK}H1}aC9g#Rz$HdAU5m+G6<;S;3%S^vO)J*eRk*B zot^iO^ZlOlo%a*~D1L!LQ3k98K)OgO3G?+tqhn%Gd=G#D5#WF=09;;{IB0=SIFQTV zn}cS_i@;Yw0KB<969Krv^b0{z@c&7fCzeR%Z9?R1&lhCzd5;COiMOO~^ZoGFsVX0uLbmk~dhIpAo zn3OCE6mpu_4nqmY@Jvv zrk#~7_^SW<`4<%(6N`SKSD^rsKM3NQ7W@T$GtX+K9n02<#bVl7*`i*8 zM6N7NiiY`mqP&c>44DMY5_5S1l!<1^bKms%+r~fN!!k^eD3Az5az~_4kRuc&p_~j6 zUnmu3h)|&jl~4QEux~p2P20aITW0x+CcVZq`3rK>yhlE}98h!lchWPFOg~lS#6_{9$GS7Lb4# zbKyLA8(a$4z(?Q~_#Au{z6B4!&)^9JAY_Dr=pjsmjc|})Bo;|TB*-eH04YIgkVd2( z=|XNG1ITma9R`P?VNeVcyM4bCSh~1`PdTdL2NVj0`?Ym82bi?!!d9sI7gfxE(Vu^TaMd;+ly<$oyGOxhHw*j zJYF4dfp^6R7vQgEYLir zc~1-0GS>>zTCR0Kt6OVATSwbhTdZBCeO~*y4nxOXCq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xTk~)A-Hy0@r$4TL;12)J=-srtFYjgFo4UW|0ro+` zL#2l$kF*}u{9^V?(*SGW)S%a3_u~bR?+@{Yp8cBj>xbdIC)6h;Bf2AXqjsYw$9%@F zJze;8_?h_G)bsq`lz*#yVfy07-`#)j9*-U$ekpl5{l}J9>aPyHp8dLGB4pyxoAftR zlLc?p-yVL)e%JLr>ix)6&IkO5(vM~z+dl<-dN7?nJ^c>@nDhMTEkxM>000SaNLh0L z01FcU01FcV0GgZ_0000CNkl + + + + + + + + + + diff --git a/docshell/test/chrome/red.png b/docshell/test/chrome/red.png new file mode 100644 index 0000000000000000000000000000000000000000..aa9ce252631ec850b02009a4a2fe9dd5e79cf09f GIT binary patch literal 82 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?sn3c)B=-a9mIR casB`U12ZEdgT&q54M1@QPgg&ebxsLQ0F+!45&!@I literal 0 HcmV?d00001 diff --git a/docshell/test/chrome/test_bug89419.xul b/docshell/test/chrome/test_bug89419.xul new file mode 100644 index 00000000000..ecd2ab382ca --- /dev/null +++ b/docshell/test/chrome/test_bug89419.xul @@ -0,0 +1,43 @@ + + + + + + + Test for Bug 89419 + + + + + + Mozilla Bug 89419 +

+ +
+
+ + + + +
diff --git a/modules/libpr0n/test/mochitest/Makefile.in b/modules/libpr0n/test/mochitest/Makefile.in index 764e15de501..367ba7e8719 100644 --- a/modules/libpr0n/test/mochitest/Makefile.in +++ b/modules/libpr0n/test/mochitest/Makefile.in @@ -76,6 +76,10 @@ _TEST_FILES = imgutils.js \ test_bug614392.html \ test_bug657191.html \ bug657191.sjs \ + bug89419-iframe.html \ + bug89419.sjs \ + test_bug89419-1.html \ + test_bug89419-2.html \ $(NULL) # Tests disabled due to intermittent orange diff --git a/modules/libpr0n/test/mochitest/bug89419-iframe.html b/modules/libpr0n/test/mochitest/bug89419-iframe.html new file mode 100644 index 00000000000..1915315633a --- /dev/null +++ b/modules/libpr0n/test/mochitest/bug89419-iframe.html @@ -0,0 +1,7 @@ + + +Bug 89419 iframe + + + + diff --git a/modules/libpr0n/test/mochitest/bug89419.sjs b/modules/libpr0n/test/mochitest/bug89419.sjs new file mode 100644 index 00000000000..a93ab6dcf53 --- /dev/null +++ b/modules/libpr0n/test/mochitest/bug89419.sjs @@ -0,0 +1,13 @@ +function handleRequest(request, response) +{ + var redirectstate = "/modules/libpr0n/test/mochitest/bug89419.sjs"; + response.setStatusLine("1.1", 302, "Found"); + if (getState(redirectstate) == "") { + response.setHeader("Location", "red.png", false); + setState(redirectstate, "red"); + } else { + response.setHeader("Location", "blue.png", false); + setState(redirectstate, ""); + } + response.setHeader("Cache-Control", "no-cache", false); +} diff --git a/modules/libpr0n/test/mochitest/test_bug89419-1.html b/modules/libpr0n/test/mochitest/test_bug89419-1.html new file mode 100644 index 00000000000..96140e66dae --- /dev/null +++ b/modules/libpr0n/test/mochitest/test_bug89419-1.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 89419 + + + + + + +Mozilla Bug 89419 +

+
+
+
+
+ +
+ + diff --git a/modules/libpr0n/test/mochitest/test_bug89419-2.html b/modules/libpr0n/test/mochitest/test_bug89419-2.html new file mode 100644 index 00000000000..9251c02538c --- /dev/null +++ b/modules/libpr0n/test/mochitest/test_bug89419-2.html @@ -0,0 +1,68 @@ + + + + + Test for Bug 89419 + + + + + + +Mozilla Bug 89419 +

+
+
+
+
+ +
+ + diff --git a/testing/mochitest/tests/SimpleTest/WindowSnapshot.js b/testing/mochitest/tests/SimpleTest/WindowSnapshot.js index f0c46b4472e..4e1ee054c73 100644 --- a/testing/mochitest/tests/SimpleTest/WindowSnapshot.js +++ b/testing/mochitest/tests/SimpleTest/WindowSnapshot.js @@ -3,7 +3,7 @@ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var gWindowUtils; try { - gWindowUtils = window.QueryInterface(CI.nsIInterfaceRequestor).getInterface(CI.nsIDOMWindowUtils); + gWindowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils); if (gWindowUtils && !gWindowUtils.compareCanvases) gWindowUtils = null; } catch (e) {