forked from newyankeecodeshop/GAJavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestWebViewContent.html
More file actions
54 lines (44 loc) · 1.56 KB
/
TestWebViewContent.html
File metadata and controls
54 lines (44 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<html>
<head>
<title>Test Title</title>
<script type="text/javascript">
function CustomTestObject () {
this.prop1 = "prop1";
this.length = 29;
this.stuff = [];
}
CustomTestObject.prototype.addObject = function (add) {
this.stuff.push(add);
};
CustomTestObject.prototype.item = function (number) {
return this.stuff[number];
}
</script>
<script type="text/javascript">
// Unit Test functions
// This tests a simple call with no arguments
function testCallback () {
GAJavaScript.performSelector('callbackNoArgs');
}
function testCallbackOneArg () {
GAJavaScript.performSelector('callbackOneArg:', "Hello World");
}
function testCallbackTypedArgs () {
GAJavaScript.performSelector('callbackTypedArgs:boolArg:intArg:floatArg:', new Date(), true, 200000, 1.5);
}
function testMultipleCallbacks () {
GAJavaScript.performSelector('callbackNoArgs');
GAJavaScript.performSelector('callbackOneArg:', "2nd call in testMultipleCallbacks");
}
function testCallbackAsArgument (callback) {
callback('arg1', 'arg2', new Date());
}
function testThrowException () {
return window.fake.object; // Will throw a TypeError
}
</script>
</head>
<body>
<p>Hello World</p>
</body>
</html>