-
-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add test for flash.net.navigateToURL
- Loading branch information
Showing
5 changed files
with
110 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package { | ||
import flash.net.URLRequest; | ||
import flash.net.URLVariables; | ||
import flash.net.navigateToURL; | ||
import flash.display.MovieClip; | ||
public class Test extends MovieClip { | ||
public function Test() | ||
{ | ||
var request:URLRequest = new URLRequest("https://example.com/purchase/"); | ||
var variables:URLVariables = new URLVariables(); | ||
variables.sku = "Test"; | ||
var empty_variables:URLVariables = new URLVariables(); | ||
var cases:Array = [ | ||
["POST", empty_variables], | ||
["GET", empty_variables], | ||
["POST", variables], | ||
["GET", variables], | ||
["POST", "sku=Test"], | ||
["GET", "sku=Test"] | ||
]; | ||
for each (var case_tuple:Array in cases) { | ||
var method:String = case_tuple[0]; | ||
var data:Object = case_tuple[1]; | ||
request.method = method; | ||
request.data = data; | ||
trace("// Method:", method); | ||
trace("// Data:", data); | ||
navigateToURL(request, "_blank"); | ||
trace(""); | ||
} | ||
} | ||
} | ||
} |
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,44 @@ | ||
// Method: POST | ||
// Data: | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/ | ||
Target: _blank | ||
Method: POST | ||
|
||
// Method: GET | ||
// Data: | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/ | ||
Target: _blank | ||
Method: GET | ||
|
||
// Method: POST | ||
// Data: sku=Test | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/ | ||
Target: _blank | ||
Method: POST | ||
Param: sku=Test | ||
|
||
// Method: GET | ||
// Data: sku=Test | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/ | ||
Target: _blank | ||
Method: GET | ||
Param: sku=Test | ||
|
||
// Method: POST | ||
// Data: sku=Test | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/?sku=Test | ||
Target: _blank | ||
Method: POST | ||
|
||
// Method: GET | ||
// Data: sku=Test | ||
Navigator::navigate_to_url: | ||
URL: https://example.com/purchase/?sku=Test | ||
Target: _blank | ||
Method: GET | ||
|
Binary file not shown.
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,2 @@ | ||
num_frames = 1 | ||
log_fetch = true |