From d55422f2a76b896560ec8ed25aae524c393ab67c Mon Sep 17 00:00:00 2001
From: Matthieu Aubry <mattab@users.noreply.github.com>
Date: Tue, 21 Feb 2017 17:31:18 +0100
Subject: [PATCH] Fixes UI tests and a regression (#11387)

* Fix UI test error

* UI tests after fixing number of activated plugins
---
 core/Plugin/Controller.php                      |   2 +-
 .../DashboardManager_removed.png                | Bin 131 -> 131 bytes
 .../Dashboard_loaded_token_auth.png             | Bin 131 -> 131 bytes
 .../expected-screenshots/Dashboard_removed.png  | Bin 131 -> 131 bytes
 tests/UI/expected-screenshots/Theme_home.png    | Bin 131 -> 131 bytes
 .../UIIntegrationTest_admin_plugins.png         | Bin 131 -> 131 bytes
 .../UIIntegrationTest_dashboard1.png            | Bin 131 -> 131 bytes
 .../UIIntegrationTest_menu_apidisallowed.png    | Bin 131 -> 131 bytes
 8 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php
index c7b9e9c78e..4d186ab15f 100644
--- a/core/Plugin/Controller.php
+++ b/core/Plugin/Controller.php
@@ -708,7 +708,7 @@ abstract class Controller
         $general = PiwikConfig::getInstance()->General;
         $view->enableFrames = $general['enable_framed_pages']
                 || (isset($general['enable_framed_logins']) && $general['enable_framed_logins']);
-        $embeddedAsIframe = (Common::getRequestVar('module') == 'Widgetize');
+        $embeddedAsIframe = (Common::getRequestVar('module', '', 'string') == 'Widgetize');
         if (!$view->enableFrames && !$embeddedAsIframe) {
             $view->setXFrameOptions('sameorigin');
         }
diff --git a/tests/UI/expected-screenshots/DashboardManager_removed.png b/tests/UI/expected-screenshots/DashboardManager_removed.png
index 2b980169e6e873af06469ad26f5a17d17d4f7ee0..38244c3084faf42e4c01c8a0a220a065527b3dbd 100644
GIT binary patch
delta 84
zcmV~$u@QhE3<c1mWeP|5AtaC?9D+c+v$nHk0Y~<|op$>4EY8xqgBrJih~DZ&B<@Qg
e3u^{~EeL>+MxUb;a<ReFt10E@e&b+OL&-nL%oa%i

delta 84
zcmV~$xe<Uc3<SU-brqDL$I@9vP=wzZVlq-UK*{XxV;`Si&bkauGPBH8#j{IcG>)P!
eiwJ!h>QGTek+7aAG{B>xs6~42cb@7FQ2GIpY83VW

diff --git a/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png b/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png
index c8ef73bf046ca42dbe8dbd9b98462b2172bedc40..28beac8fa7185ee7e632fe066dc19daec0ab83f5 100644
GIT binary patch
delta 84
zcmV~$yAgmO3;@uxWeP_i3HdODLl8*rtnF-Bz>$4#AN%;^T1}CXwCPaEZnhAhf{=vf
eH0%*39)mbj$;lxS2M)#-+^3i4e&b}aYE*vDAQs#J

delta 84
zcmV~$%MpMe3<bd9N)?s>Bt$5}BJz36c=qO%1}xd#op$=<sx20+&K%X$tpG)djok+Z
e)NFx5hl?wQ5&Dd10M8(>u;u4|adbMT)cgZP;28k`

diff --git a/tests/UI/expected-screenshots/Dashboard_removed.png b/tests/UI/expected-screenshots/Dashboard_removed.png
index 961419dfeef829321ba933c656d30841a93f2dbd..7a62f15c316d81043e408d73a5f57a2ea26e8593 100644
GIT binary patch
delta 84
zcmV~$yAgmO3;@uxWeP{gha_YOhkyj`tnF-Bz>$4#AN%<9Y9OPDc3+T~f`Q8F61^q^
e1|@eig*GXKY{}xr6%A?#4tFlk{mxU^jHvvz6cwQW

delta 84
zcmV~$u@QhE3<c1$WeP`tB;>;o4iO-^v$nHk0Y~<|eeC1Yt5}obRDh_=%W@mUjl#y{
f=*4wbu^@tG30~Sw;R{_z(dwG%xnDmkLmBA@&sr9G

diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png
index 17793e92d271c95be208710241637f1f55d2c072..3972a8774d2fd2d72e73b4fbb4fcb362da8d1e6f 100644
GIT binary patch
delta 84
zcmWN`u@QhE3`XIjWeP`tACkZj4nZKfv$nH!0Y{edz3&Zg`1mAIw1lb28hA(rnY;D^
fo2$z{Sr*`PICdr<)o6>-hO8X#>#>6h3)T1o=aCl&

delta 84
zcmWN{u@S%^2mrvdb&8AtDhNYl2o<<Xoi42lWaQ-Q-)X0p&w|40IK2_zuuxYQ<2w2x
f0xKGS02_lGvFWN<mb9RNE;gm+`+EGK%B+w-+ou+$

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png
index c66bface3c1a0c558805aa407fa6601b9207bf20..83ce8271591d51db060361b7450e1d5e6777e0f4 100644
GIT binary patch
delta 84
zcmWN`yA6OK5CG87GKC}D2RIqRA>clVwVf>sII?svc`L2-wF@m=Xhakr4LDHQEDY2%
f)YyRyi9v8v1Zt^B&fzrMNke;n?$?iAcX0jzA@UcY

delta 84
zcmWN`yAgmO3;@uxWeP_?@*lz>fFyU;cD5|w$oks1wza){nv-B;G_9$lPEoE6cv!V5
e;9`kxOaeR^@Br!&lGOd*$VuhCp4bi9NXrM(sTR-x

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
index 018d3b2cbd4b611029ef47c4e946f08f711a8b74..48849c9345fdc02a2891bc6505f23b650a0466b3 100644
GIT binary patch
delta 84
zcmV~$yAgmO3;@uxWeP_Kkna!<0U^1wwzFjcNA|sa?BnBWNeo#=LB>!82WOJc&cK$A
es|)Dpb4+xZ0S4Hs`U*nw)TZUR-#Af4xs@OBrWX+a

delta 84
zcmV~$u@S%^2mruK>l7IQ1qFu45GZh$I$c^9$jJHM$3DJsN$A9Ihd#qWjS{HVgx;2g
eaM$!CGC`k`DsxrEiaC;DwU$<%`;C)?8KL|OxEGTE

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_menu_apidisallowed.png b/tests/UI/expected-screenshots/UIIntegrationTest_menu_apidisallowed.png
index 21e8f2e424937934060e3b5b9dffa34d967200e2..bdfb7e2fb05ae7526b7b466a50dd0f472d6e423b 100644
GIT binary patch
delta 84
zcmV~$yA6Oa3<W^ZW(r2I<0Q6+V2FI4C2Bg_EWpUz?PDKbyP)L3A(c9#Om#Pq){;Xo
fmRc7@6V}1#UU~#;4lJiZHf<t3_lvW*m}~k0<)Ifz

delta 84
zcmWN{u?@f=3<N;YGDSup*cd!ShIqi1Qm0GH0vS1!C*2Awd~$(n&kpz)fK^eab~2_j
fGC_4#x5PGzP%q$JNT3@q&e~FZ?$-`hs-?sqEl(Hk

-- 
GitLab