Skip to content

Commit

Permalink
refactor: removed IE and MS Edge Legacy leftovers from test\client\fi…
Browse files Browse the repository at this point in the history
…xtures (DevExpress#7960)

<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
_Describe the problem you want to address or the feature you want to
implement._

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
_Provide a link to the existing issue(s), if any._

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
  • Loading branch information
Aleksey28 authored Aug 22, 2023
1 parent 6424187 commit 5c58735
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
11 changes: 3 additions & 8 deletions test/client/fixtures/core/array-utils-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const hammerhead = window.getTestCafeModule('hammerhead');
const browserUtils = hammerhead.utils.browser;

const testCafeCore = window.getTestCafeModule('testCafeCore');
const arrayUtils = testCafeCore.arrayUtils;

Expand Down Expand Up @@ -139,11 +136,9 @@ test('isArray()', function () {
test('from()', function () {
deepEqual(arrayUtils.from('foo'), ['f', 'o', 'o']);

if (!browserUtils.isIE) {
deepEqual(arrayUtils.from(array, function (x) {
return x + x;
}), [2, 4, 6, 8, 10]);
}
deepEqual(arrayUtils.from(array, function (x) {
return x + x;
}), [2, 4, 6, 8, 10]);
});

test('find()', function () {
Expand Down
11 changes: 2 additions & 9 deletions test/client/fixtures/core/dom-utils-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const hammerhead = window.getTestCafeModule('hammerhead');
const browserUtils = hammerhead.utils.browser;
const testCafeCore = window.getTestCafeModule('testCafeCore');
const domUtils = testCafeCore.domUtils;

asyncTest('isIFrameWindowInDOM', function () {
expect(browserUtils.isIE ? 2 : 1);
expect(1);

let messageCounter = 0;

Expand All @@ -17,15 +15,10 @@ asyncTest('isIFrameWindowInDOM', function () {
if (messageCounter === 0) {
equal(event.data, 'true');

const iFramePostMessage = iframe.contentWindow.postMessage.bind(iframe.contentWindow);

document.body.removeChild(iframe);

//NOTE: In WebKit, scripts cannot be executed in a removed iframe. Therefore, the test is finished here.
if (browserUtils.isIE)
iFramePostMessage('isIFrameWindowInDOM', '*');
else
finishTest();
finishTest();
}
else {
equal(event.data, 'false');
Expand Down
6 changes: 1 addition & 5 deletions test/client/fixtures/driver/script-execution-barrier-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,12 @@ $(document).ready(function () {
const emitter = new ScriptExecutionEmitter();
const barrier = new ScriptExecutionBarrier(emitter);

let scriptCounter = 0;

window.stopAppending = false;
window.appendCustomScript = function () {
const script = document.createElement('script');
const scriptContent = encodeURIComponent('if(!window.stopAppending)window.appendCustomScript()');

// HACK: we should request different URLs to avoid caching of response in IE 10
script.src = '/xhr-test/' + scriptCounter + '?expectedResponse=' + scriptContent;
scriptCounter++;
script.src = '/xhr-test/50?expectedResponse=' + scriptContent;

document.body.appendChild(script);
};
Expand Down

0 comments on commit 5c58735

Please sign in to comment.