If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Get the rest of the request module tests reenabled.

RESOLVED FIXED

Status

Add-on SDK
General
P2
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: KWierso, Assigned: KWierso)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
+++ This bug was initially created as a clone of Bug #701516 +++

A bunch of tests in test-request.js are commented out because they require a network connection.  Now that we have the httpd module, we should use it to provide a local server for those tests so we can start running them again.

---

Bug 701516 reenabled about half of the request tests, because I was waiting on getting the source files for the rest of the tests. I now have those files, so I can work on getting the rest turned back on now.
(Assignee)

Comment 1

6 years ago
Myk: I just blew away my previous branch and started from a fresh pull from the master branch which includes the changes landed in 701516, and now I'm getting lots of warnings logged to the console that I wasn't seeing when I was working on 701516.

Can you see if you see any of these when you run the request module tests?

Running tests on Firefox 8.0/Gecko 8.0 ({ec8030f7-c20a-464f-9b0e-13a3a9e97384}) under winnt/x86-msvc
.
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2074 column: 55 source:
"  var fis = new FileInputStream(headerFile, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2074 column: 55 source:
"  var fis = new FileInputStream(headerFile, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2074 column: 55 source:
"  var fis = new FileInputStream(headerFile, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2566 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2566 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2566 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2660 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2660 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
console: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "res
ource://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0b
c0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 2660 column: 53 source:
"      var fis = new FileInputStream(file, PR_RDONLY, 0444,
"}]
.console: [JavaScript Warning: "reference to undefined property Ci.nsIHttpServer" {file: "resource:/
/0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0bc0a5b2-
5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 704}]
console: [JavaScript Error: "no element found" {file: "http://localhost/safebrowsing-dummy/newkey" l
ine: 1}]
....console: [JavaScript Warning: "reference to undefined property Ci.nsIHttpServer" {file: "resourc
e://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0bc0a5
b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 704}]
.console: [JavaScript Warning: "reference to undefined property Ci.nsIHttpServer" {file: "resource:/
/0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0bc0a5b2-
5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 704}]
.....console: [JavaScript Warning: "reference to undefined property Ci.nsIHttpServer" {file: "resour
ce://0bc0a5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/cuddlefish.js -> resource://0bc0a
5b2-5d3b-49dc-876b-fb296081070a-at-jetpack-api-utils-lib/httpd.js" line: 704}]
..warning: 14 warnings or errors were logged to the platform's nsIConsoleService, which could be of
no consequence; however, they could also be indicative of aberrant behavior.

13 of 13 tests passed.
Total time: 11.969000 seconds
Program terminated successfully.
(Assignee)

Comment 2

6 years ago
Created attachment 575108 [details]
Link to pull request 265

Additionally, I don't think httpd.js can process PHP files, so re-enabling most of the remaining tests might be harder than I thought.

This pull request currently re-enables one additional test, and changes the rest of the disabled tests to be ready to use httpd.js for them. (The tests can now start/stop the server, and the URL for the requests point to the files on the localhost server, not somewhere out on the internet.)

More details over at the pull request.

I'm kinda stuck if the PHP files can't be processed by the webserver module.
Attachment #575108 - Flags: review?(myk)
(Assignee)

Updated

6 years ago
Priority: -- → P2
Comment on attachment 575108 [details]
Link to pull request 265

Comments in the pull request.
Attachment #575108 - Flags: review?(myk) → review-
(Assignee)

Comment 4

5 years ago
Created attachment 693186 [details] [diff] [review]
Convert testKnownHeader and testComplexHeader to use httpd.js and reenable them

This gets two of the tests converted and reenabled.

Not sure when I'll get a chance to figure out the remaining tests are doing, so uploading what I have done now.
Attachment #575108 - Attachment is obsolete: true
Attachment #693186 - Flags: review?(rFobic)
Comment on attachment 693186 [details] [diff] [review]
Convert testKnownHeader and testComplexHeader to use httpd.js and reenable them

Review of attachment 693186 [details] [diff] [review]:
-----------------------------------------------------------------

::: test/test-request.js
@@ +107,5 @@
> +exports.testComplexHeader = function (test) {
> +  let srv = startServerAsync(port, basePath);
> +
> +  let basename = "test-request-complex-headers.sjs";
> +  let content = data.load("test-request-complex-headers.sjs");

Having SDK data folder is pretty problematic for landing to FF,
could you please use something along this lines instead ?

https://github.com/mozilla/addon-sdk/blob/master/test/test-loader.js#L10-L11

You can just export `handleRequest` function and use `handleRequest.toString()` here instead.



Actually I would even go head and inline `handleRequest` function here, it would also easier to follow code.
Attachment #693186 - Flags: review?(rFobic) → review+
Feel free to land after addressing comment above.
Thanks
(Assignee)

Comment 7

5 years ago
(In reply to Irakli Gozilalishvili [:irakli] [:gozala] [@gozala] from comment #6)
> Feel free to land after addressing comment above.
> Thanks

https://github.com/mozilla/addon-sdk/commit/a655b0523c08012269e388e23c506fbb0586f6ad
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.