Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core-http] fix browser tests on Firefox #9091

Merged
merged 2 commits into from
May 27, 2020

Conversation

jeremymeng
Copy link
Member

Issue 1) on Firefox user agent string contains more than two
fields:

"core-http/1.1.3 OS/WindowsNT 10.0; Win64; x64"

while on Chrome it has just two:

"core-http/1.1.3 OS/Win32"

Changed to verify it has at least two fields.

Issue 2) Most likely either Chrome has a bug, or behavior of dates
before January 1, 1970 is not well defined. For the date Tue, Jan 1
0001 00:00:00 GMT, Chrome sets the year to be 2001, while Firefox
keeps the year as 0001.

Changed to use another date in the test.

Issue 3) The error message when parsing xml with an input of undefined
or null is different between Chrome and Firefox.

Changed to pass on either one.

Issue 1) on Firefox user agent string contains more than two
fields:

  "core-http/1.1.3 OS/WindowsNT 10.0; Win64; x64"

while on Chrome it has just two:

  "core-http/1.1.3 OS/Win32"

Changed to verify it has at least two fields.

Issue 2) Most likely either Chrome has a bug, or behavior of dates
before January 1, 1970 is not well defined. For the date Tue, Jan 1
0001 00:00:00 GMT, Chrome sets the year to be 2001, while Firefox
keeps the year as 0001.

Changed to use another date in the test.

Issue 3) The error message when parsing xml with an input of undefined
or null is different between Chrome and Firefox.

Changed to pass on either one.
@@ -286,9 +286,9 @@ describe("msrest", function() {
required: false,
serializedName: "DateTimeRfc1123"
};
const rfc = new Date("Mon, 01 Jan 0001 00:00:00 GMT");
const rfc = new Date("Thu, 01 Jan 3001 00:00:00 GMT");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bizarre to me that we're worried about times thousands of years from the present

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I will update to some date in 2020

error.message.indexOf("Document is empty"),
-1,
`error.message ("${error.message}") should have contained "Document is empty"`
assert.ok(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth checking this message? Should we just assert that it throws?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the old behavior of verifying that it's a parsing error.

@jeremymeng jeremymeng merged commit fce5ed3 into Azure:master May 27, 2020
@jeremymeng jeremymeng deleted the core-http-firefox-test-failure branch May 27, 2020 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants