Skip to content

Commit

Permalink
fix: live preview integ test fails after secure domain seperation
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Jan 5, 2024
1 parent 5c5a714 commit 8c60c8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ define(function (require, exports, module) {

function getContent(path, url) {
if(!_staticServerInstance){
return;
return Promise.reject("Static serve not started!");
}
if(!url.startsWith(_staticServerInstance._baseUrl)) {
return Promise.reject("Not serving content as url belongs to another phcode instance: " + url);
Expand Down
8 changes: 3 additions & 5 deletions test/spec/LiveDevelopmentMultiBrowser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ define(function (require, exports, module) {
await awaits(500);
iFrame = testWindow.document.getElementById("panel-live-preview-frame");
let srcURL = new URL(iFrame.src);
expect(srcURL.pathname.endsWith("pageLoader.html")).toBeTrue();
expect(srcURL.searchParams.get("URL").endsWith("sub/icon_chevron.png")).toBeTrue();
expect(srcURL.pathname.endsWith("sub/icon_chevron.png")).toBeTrue();

// now switch back to old file
await _editFileAndVerifyLivePreview("simple1.html", {line: 11, ch: 45}, 'hello world ',
Expand Down Expand Up @@ -511,7 +510,7 @@ define(function (require, exports, module) {
await endPreviewSession();
}, 30000);

it("should pin live previews ping html file", async function () {
it("should pin live previews pin html file", async function () {
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["simple1.html"]),
"SpecRunnerUtils.openProjectFiles simple1.html");

Expand All @@ -534,8 +533,7 @@ define(function (require, exports, module) {
await awaits(1000);
let outerIFrame = testWindow.document.getElementById("panel-live-preview-frame");
let srcURL = new URL(outerIFrame.src);
expect(srcURL.pathname.endsWith("pageLoader.html")).toBeTrue();
expect(srcURL.searchParams.get("URL").endsWith("sub/icon_chevron.png")).toBeTrue();
expect(srcURL.pathname.endsWith("sub/icon_chevron.png")).toBeTrue();

await endPreviewSession();
}, 30000);
Expand Down

0 comments on commit 8c60c8e

Please sign in to comment.