Closed Bug 703108 Opened 13 years ago Closed 12 years ago

Get the rest of the request module tests reenabled.

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KWierso, Assigned: KWierso)

References

Details

Attachments

(1 file, 1 obsolete file)

+++ 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.
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.
Attached file Link to pull request 265 (obsolete) —
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)
Comment on attachment 575108 [details]
Link to pull request 265

Comments in the pull request.
Attachment #575108 - Flags: review?(myk) → review-
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
(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
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: