Skip to content

Commit

Permalink
Bug 1517167 Part 4 - Test fixes for introduction information in dynam…
Browse files Browse the repository at this point in the history
…ically generated <script> elements, r=lsmyth.

--HG--
extra : rebase_source : f1687de0167824f9137eeb46c44198716d013adb
  • Loading branch information
bhackett1024 committed Jan 8, 2019
1 parent 014d919 commit 049a234
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ requestLongerTimeout(4);
// events (React development version 15.4.1) using JSX.

const TEST_LIB = URL_ROOT + "lib_react_dom_15.4.1.js";
const TEST_LIB_BABEL = URL_ROOT + "lib_babel_6.21.0_min.js";
const TEST_EXTERNAL_LISTENERS = URL_ROOT + "react_external_listeners.js";
const TEST_URL = URL_ROOT + "doc_markup_events_react_development_15.4.1_jsx.html";

Expand All @@ -31,7 +32,7 @@ const TEST_DATA = [
},
{
type: "onClick",
filename: TEST_URL + ":10",
filename: TEST_LIB_BABEL + ":10",
attributes: [
"Bubbling",
"React"
Expand Down Expand Up @@ -95,7 +96,7 @@ const TEST_DATA = [
},
{
type: "onMouseUp",
filename: TEST_URL + ":10",
filename: TEST_LIB_BABEL + ":10",
attributes: [
"Bubbling",
"React"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ requestLongerTimeout(4);
// events (React production version 15.3.1) using JSX.

const TEST_LIB = URL_ROOT + "lib_react_with_addons_15.3.1_min.js";
const TEST_LIB_BABEL = URL_ROOT + "lib_babel_6.21.0_min.js";
const TEST_EXTERNAL_LISTENERS = URL_ROOT + "react_external_listeners.js";
const TEST_URL = URL_ROOT + "doc_markup_events_react_production_15.3.1_jsx.html";

Expand All @@ -31,7 +32,7 @@ const TEST_DATA = [
},
{
type: "onClick",
filename: TEST_URL + ":10",
filename: TEST_LIB_BABEL + ":10",
attributes: [
"Bubbling",
"React"
Expand Down Expand Up @@ -95,7 +96,7 @@ const TEST_DATA = [
},
{
type: "onMouseUp",
filename: TEST_URL + ":10",
filename: TEST_LIB_BABEL + ":10",
attributes: [
"Bubbling",
"React"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ requestLongerTimeout(4);
// events (React production version 16.2.0) using JSX.

const TEST_LIB = URL_ROOT + "lib_react_dom_16.2.0_min.js";
const TEST_LIB_BABEL = URL_ROOT + "lib_babel_6.21.0_min.js";
const TEST_EXTERNAL_LISTENERS = URL_ROOT + "react_external_listeners.js";
const TEST_URL = URL_ROOT + "doc_markup_events_react_production_16.2.0_jsx.html";

Expand All @@ -31,7 +32,7 @@ const TEST_DATA = [
},
{
type: "onClick",
filename: TEST_URL + ":26",
filename: TEST_LIB_BABEL + ":26",
attributes: [
"Bubbling",
"React"
Expand Down Expand Up @@ -95,7 +96,7 @@ const TEST_DATA = [
},
{
type: "onMouseUp",
filename: TEST_URL + ":26",
filename: TEST_LIB_BABEL + ":26",
attributes: [
"Bubbling",
"React"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
// called eval.
const source = frame.script.source;
const frame2 = frame.older;
const frame3 = frame2.older;

ok(source.introductionType === "eval",
"top frame's source was introduced by 'eval'");
Expand All @@ -78,16 +79,14 @@
ok(source.introductionScript.source.element === script2DO,
"eval frame's introducer belongs to script2 element");

// The frame that called eval, in turn, should have no introduction
// information. (In the future, we certainly could point at the call
// that inserted the script element into the document; if that happens,
// we can update this test.)
// The frame that called eval, in turn, was introduced at the call that
// inserted the script element into the document.
ok(frame2.script.source.introductionType === "scriptElement",
"older frame has no introduction type");
ok(frame2.script.source.introductionScript === undefined,
"older frame has no introduction script");
ok(frame2.script.source.introductionOffset === undefined,
"older frame has no introduction offset");
ok(frame2.script.source.introductionScript === frame3.script,
"older frame has introduction script");
ok(frame2.script.source.introductionOffset === frame3.offset,
"older frame has introduction offset");

SimpleTest.finish();
}
Expand Down

0 comments on commit 049a234

Please sign in to comment.