forked from BrowserWorks/Waterfox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge inbound to mozilla-central. a=merge
- Loading branch information
Showing
49 changed files
with
1,288 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
devtools/client/netmonitor/test/browser_net_edit_resend_with_filtering.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ | ||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
/** | ||
* Tests if resending a XHR request while filtering XHR displays | ||
* the correct requests | ||
*/ | ||
add_task(async function() { | ||
const { tab, monitor } = await initNetMonitor(POST_RAW_URL); | ||
|
||
const { document, store, windowRequire, parent } = monitor.panelWin; | ||
const parentDocument = parent.document; | ||
const Actions = windowRequire("devtools/client/netmonitor/src/actions/index"); | ||
store.dispatch(Actions.batchEnable(false)); | ||
|
||
// Execute XHR request and filter by XHR | ||
await performRequests(monitor, tab, 1); | ||
document.querySelector(".requests-list-filter-xhr-button").click(); | ||
|
||
// Confirm XHR request and click it | ||
const xhrRequestItem = document.querySelectorAll(".request-list-item")[0]; | ||
EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequestItem); | ||
|
||
const { | ||
getSelectedRequest | ||
} = windowRequire("devtools/client/netmonitor/src/selectors/index"); | ||
const firstRequest = getSelectedRequest(store.getState()); | ||
|
||
// Open context menu and execute "Edit & Resend". | ||
EventUtils.sendMouseEvent({ type: "contextmenu" }, xhrRequestItem); | ||
parentDocument.querySelector("#request-list-context-resend").click(); | ||
|
||
// Click Resend | ||
await waitUntil(() => document.querySelector("#custom-request-send-button")); | ||
document.querySelector("#custom-request-send-button").click(); | ||
|
||
// Filtering by "other" so the resent request is visible after completion | ||
document.querySelector(".requests-list-filter-other-button").click(); | ||
|
||
// Select the cloned request | ||
document.querySelectorAll(".request-list-item")[0].click(); | ||
const resendRequest = getSelectedRequest(store.getState()); | ||
|
||
ok(resendRequest.id !== firstRequest.id, | ||
"The second XHR request was made and is unique"); | ||
|
||
ok(resendRequest.id.replace(/-clone$/, "") == firstRequest.id, | ||
"The second XHR request is a clone of the first"); | ||
|
||
return teardown(monitor); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Test for same URLs nested iframes</title> | ||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> | ||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> | ||
</head> | ||
<body> | ||
<script> | ||
|
||
SimpleTest.waitForExplicitFinish(); | ||
|
||
function reportState(msg) { | ||
if (location.href.includes("#")) { | ||
parent.postMessage(msg, "*"); | ||
return; | ||
} | ||
|
||
if (msg == "OK 1") { | ||
ok(true, "First frame loaded"); | ||
} else if (msg == "KO 2") { | ||
ok(true, "Second frame load failed"); | ||
SimpleTest.finish(); | ||
} else { | ||
ok(false, "Unknown message: " + msg); | ||
} | ||
} | ||
|
||
addEventListener("message", event => { | ||
reportState(event.data); | ||
}); | ||
|
||
var recursion; | ||
if (!location.href.includes("#")) { | ||
recursion = 1; | ||
} else { | ||
recursion = parseInt(localStorage.recursion) + 1; | ||
} | ||
localStorage.recursion = "" + recursion; | ||
|
||
var ifr = document.createElement('iframe'); | ||
ifr.src = location.href.split("#")[0] + "#" + recursion; | ||
document.body.appendChild(ifr); | ||
|
||
ifr.onload = function() { | ||
reportState("OK " + recursion); | ||
} | ||
|
||
ifr.onerror = function() { | ||
reportState("KO " + recursion); | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.