Skip to content

Commit

Permalink
Bug 1778442 - Update devtools/client/shared test files to use https r…
Browse files Browse the repository at this point in the history
…=ochameau

Differential Revision: https://phabricator.services.mozilla.com/D151243
  • Loading branch information
moztomer committed Jul 8, 2022
1 parent ba23af9 commit dfd3fc0
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion devtools/client/shared/components/test/chrome/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const TestRenderer = browserRequire(
"devtools/client/shared/vendor/react-test-renderer"
);

var EXAMPLE_URL = "http://example.com/browser/browser/devtools/shared/test/";
var EXAMPLE_URL = "https://example.com/browser/browser/devtools/shared/test/";

SimpleTest.registerCleanupFunction(() => {
window._snapshots = null;
Expand Down
66 changes: 33 additions & 33 deletions devtools/client/shared/components/test/chrome/test_frame_01.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// Check when there's a column
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 55,
column: 10,
}
Expand All @@ -43,48 +43,48 @@
line: 55,
column: 10,
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:55:10",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js:55:10",
});

// Check when there's no column
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 55,
}
}, {
file: "mahscripts.js",
line: 55,
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:55",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js:55",
});

// Check when column === 0
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 55,
column: 0,
}
}, {
file: "mahscripts.js",
line: 55,
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:55",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js:55",
});

// Check when there's an error in CSS (View source in Style Editor)
await checkFrameComponent({
frame: {
source: "http://myfile.com/cafebabe.css",
source: "https://myfile.com/cafebabe.css",
line: 13,
},
messageSource: "css",
}, {
file: "cafebabe.css",
line: 13,
shouldLink: true,
tooltip: "View source in Style Editor → http://myfile.com/cafebabe.css:13",
tooltip: "View source in Style Editor → https://myfile.com/cafebabe.css:13",
});


Expand Down Expand Up @@ -144,33 +144,33 @@
// no line/column info should render
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
column: 55,
}
}, {
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check when line is 0; this should be an invalid
// line option, so don't render line/column
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
column: 55,
}
}, {
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check that line and column can be strings
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: "10",
column: "55",
}
Expand All @@ -179,81 +179,81 @@
line: 10,
column: 55,
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:10:55",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js:10:55",
});

// Check that line and column can be strings,
// and that the `0` rendering rules apply when they are strings as well
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: "0",
column: "55",
}
}, {
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check that the showFullSourceUrl option works correctly
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
},
showFullSourceUrl: true
}, {
file: "http://myfile.com/mahscripts.js",
file: "https://myfile.com/mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check that the showFunctionName option works correctly
await checkFrameComponent({
frame: {
functionDisplayName: "myfun",
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
}
}, {
functionName: null,
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

await checkFrameComponent({
frame: {
functionDisplayName: "myfun",
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
},
showFunctionName: true
}, {
functionName: "myfun",
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check that anonymous function name is not displayed unless explicitly enabled
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
},
showFunctionName: true
}, {
functionName: null,
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 0,
},
showFunctionName: true,
Expand All @@ -262,35 +262,35 @@
functionName: "<anonymous>",
file: "mahscripts.js",
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js",
});

// Check if file is rendered with "/" for root documents when showEmptyPathAsHost is false
await checkFrameComponent({
frame: {
source: "http://www.cnn.com/",
source: "https://www.cnn.com/",
line: "1",
},
showEmptyPathAsHost: false,
}, {
file: "/",
line: "1",
shouldLink: true,
tooltip: "View source in Debugger → http://www.cnn.com/:1",
tooltip: "View source in Debugger → https://www.cnn.com/:1",
});

// Check if file is rendered with hostname for root documents when showEmptyPathAsHost is true
await checkFrameComponent({
frame: {
source: "http://www.cnn.com/",
source: "https://www.cnn.com/",
line: "1",
},
showEmptyPathAsHost: true,
}, {
file: "www.cnn.com",
line: "1",
shouldLink: true,
tooltip: "View source in Debugger → http://www.cnn.com/:1",
tooltip: "View source in Debugger → https://www.cnn.com/:1",
});

const resolvedLocation = {
Expand Down Expand Up @@ -327,7 +327,7 @@
// a prefix should render before source
await checkFrameComponent({
frame: {
source: "http://myfile.com/mahscripts.js",
source: "https://myfile.com/mahscripts.js",
line: 55,
column: 10,
options: { logPoint: true },
Expand All @@ -337,7 +337,7 @@
line: 55,
column: 10,
shouldLink: true,
tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:55:10",
tooltip: "View source in Debugger → https://myfile.com/mahscripts.js:55:10",
});

function checkFrameComponent(input, expected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@

const stacktrace = [
{
filename: "http://myfile.com/mahscripts.js",
filename: "https://myfile.com/mahscripts.js",
lineNumber: 55,
columnNumber: 10,
functionName: null,
},
// Simulated Redux frame
{
functionName: "rootReducer",
filename: "http://myfile.com/loader.js -> http://myfile.com/redux.js",
filename: "https://myfile.com/loader.js -> https://myfile.com/redux.js",
lineNumber: 2,
},
{
functionName: "loadFunc",
filename: "http://myfile.com/loader.js -> http://myfile.com/loadee.js",
filename: "https://myfile.com/loader.js -> https://myfile.com/loadee.js",
lineNumber: 10,
},
// Simulated react frames
...(Array.from({length: REACT_FRAMES_COUNT}, (_, i) => ({
functionName: "internalReact" + (REACT_FRAMES_COUNT - i),
filename: "http://myfile.com/loader.js -> http://myfile.com/react.js",
filename: "https://myfile.com/loader.js -> https://myfile.com/react.js",
lineNumber: Number(i.toString().repeat(2)),
}))),
{
filename: "http://myfile.com/mahscripts.js",
filename: "https://myfile.com/mahscripts.js",
lineNumber: 10,
columnNumber: 3,
functionName: "onClick",
Expand All @@ -71,11 +71,11 @@
ok(traceEl, "Rendered SmartTrace has an element");

isDeeply(getStacktraceText(traceEl), [
`<anonymous> http://myfile.com/mahscripts.js:55`,
`<anonymous> https://myfile.com/mahscripts.js:55`,
`rootReducer Redux`,
`loadFunc http://myfile.com/loadee.js:10`,
`loadFunc https://myfile.com/loadee.js:10`,
`▶︎ React 10`,
`onClick http://myfile.com/mahscripts.js:10`,
`onClick https://myfile.com/mahscripts.js:10`,
], "React frames are grouped - Redux frame is not");

info("Expand React group");
Expand All @@ -85,9 +85,9 @@
await onReactGroupExpanded;

isDeeply(getStacktraceText(traceEl), [
`<anonymous> http://myfile.com/mahscripts.js:55`,
`<anonymous> https://myfile.com/mahscripts.js:55`,
`rootReducer Redux`,
`loadFunc http://myfile.com/loadee.js:10`,
`loadFunc https://myfile.com/loadee.js:10`,
`▼ React 10`,
`| internalReact10`,
`| internalReact9`,
Expand All @@ -99,7 +99,7 @@
`| internalReact3`,
`| internalReact2`,
`| internalReact1`,
`onClick http://myfile.com/mahscripts.js:10`,
`onClick https://myfile.com/mahscripts.js:10`,
], "React frames can be expanded");

info("Collapse React group");
Expand All @@ -109,11 +109,11 @@
await onReactGroupExpanded;

isDeeply(getStacktraceText(traceEl), [
`<anonymous> http://myfile.com/mahscripts.js:55`,
`<anonymous> https://myfile.com/mahscripts.js:55`,
`rootReducer Redux`,
`loadFunc http://myfile.com/loadee.js:10`,
`loadFunc https://myfile.com/loadee.js:10`,
`▶︎ React 10`,
`onClick http://myfile.com/mahscripts.js:10`,
`onClick https://myfile.com/mahscripts.js:10`,
], "React frames can be collapsed");
});

Expand Down
Loading

0 comments on commit dfd3fc0

Please sign in to comment.