flok 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/drivers/chrome/src/event.js +1 -0
- data/app/kern/controller.js +1 -0
- data/app/kern/mod/debug.js +18 -7
- data/app/kern/mod/event.js +8 -0
- data/docs/branches.md +4 -0
- data/docs/controllers.md +2 -2
- data/docs/mod/debug.md +5 -2
- data/docs/mod/debug/dump_ui.md +1 -0
- data/lib/flok/user_compiler.rb +10 -12
- data/lib/flok/user_compiler_templates/ctable.js.erb +1 -1
- data/lib/flok/version.rb +1 -1
- data/spec/etc/cli_spec.rb +0 -2
- data/spec/etc/user_compiler/controller0.rb +0 -1
- data/spec/etc/user_compiler_spec.rb +3 -2
- data/spec/kern/assets/controller0.rb +0 -1
- data/spec/kern/assets/controller1.rb +0 -2
- data/spec/kern/assets/controller_bare.rb +3 -2
- data/spec/kern/assets/controller_def.rb +0 -1
- data/spec/kern/assets/{controller_context.rb → controller_describe.rb} +3 -2
- data/spec/kern/assets/controller_spots.rb +6 -1
- data/spec/kern/assets/controller_spots_embed.rb +6 -3
- data/spec/kern/assets/controller_spots_embed_removed.rb +9 -3
- data/spec/kern/assets/embed_info.rb +0 -2
- data/spec/kern/assets/event_gw.rb +0 -2
- data/spec/kern/assets/forward_and_back.rb +37 -0
- data/spec/kern/assets/goto.rb +0 -3
- data/spec/kern/assets/goto2.rb +0 -2
- data/spec/kern/assets/lower_event.rb +0 -2
- data/spec/kern/assets/raise_event.rb +0 -2
- data/spec/kern/assets/rest_service.rb +0 -1
- data/spec/kern/assets/send_event.rb +0 -1
- data/spec/kern/assets/test_event.rb +0 -1
- data/spec/kern/assets/test_event2.rb +0 -2
- data/spec/kern/assets/test_event3.rb +0 -2
- data/spec/kern/assets/timer_service.rb +0 -1
- data/spec/kern/controller_spec.rb +12 -12
- data/spec/kern/debug_spec.rb +12 -6
- data/spec/kern/debug_ui_spec.rb +266 -186
- data/spec/kern/rest_service_spec.rb +1 -1
- data/spec/kern/timer_service_spec.rb +1 -1
- metadata +7 -4
data/spec/kern/assets/goto.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
controller :my_controller do
|
2
|
-
view :test_view
|
3
2
|
spots "hello", "world"
|
4
3
|
|
5
4
|
action :my_action do
|
@@ -20,8 +19,6 @@ controller :my_controller do
|
|
20
19
|
end
|
21
20
|
|
22
21
|
controller :my_controller2 do
|
23
|
-
view :test_view2
|
24
|
-
|
25
22
|
action :my_action do
|
26
23
|
on_entry %{
|
27
24
|
}
|
data/spec/kern/assets/goto2.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
controller :my_controller do
|
2
|
-
view :test_view
|
3
2
|
spots "hello", "world"
|
4
3
|
|
5
4
|
action :my_action do
|
@@ -16,7 +15,6 @@ controller :my_controller do
|
|
16
15
|
end
|
17
16
|
|
18
17
|
controller :my_sub_controller do
|
19
|
-
view :test_view2
|
20
18
|
spots "hello", "world"
|
21
19
|
|
22
20
|
action :my_action do
|
@@ -1,5 +1,4 @@
|
|
1
1
|
controller :my_controller do
|
2
|
-
view :test_view
|
3
2
|
spots "hello", "world"
|
4
3
|
|
5
4
|
action :my_action do
|
@@ -16,7 +15,6 @@ controller :my_controller do
|
|
16
15
|
end
|
17
16
|
|
18
17
|
controller :my_sub_controller do
|
19
|
-
view :test_view2
|
20
18
|
spots "hello", "world"
|
21
19
|
|
22
20
|
action :my_action do
|
@@ -1,5 +1,4 @@
|
|
1
1
|
controller :my_controller do
|
2
|
-
view :test_view
|
3
2
|
spots "content"
|
4
3
|
|
5
4
|
action :my_action do
|
@@ -17,7 +16,6 @@ end
|
|
17
16
|
#This controller will receive test_event but should
|
18
17
|
#pass it up to 'my_controller'
|
19
18
|
controller :my_controller2 do
|
20
|
-
view :test_view
|
21
19
|
|
22
20
|
action :my_action do
|
23
21
|
on_entry %{
|
@@ -1,5 +1,4 @@
|
|
1
1
|
controller :my_controller do
|
2
|
-
view :test_view
|
3
2
|
spots "content"
|
4
3
|
|
5
4
|
action :my_action do
|
@@ -12,7 +11,6 @@ end
|
|
12
11
|
#This controller will receive test_event but should
|
13
12
|
#pass it up to 'my_controller'
|
14
13
|
controller :my_controller2 do
|
15
|
-
view :test_view
|
16
14
|
|
17
15
|
action :my_action do
|
18
16
|
on_entry %{
|
@@ -25,7 +25,7 @@ RSpec.describe "kern:controller_spec" do
|
|
25
25
|
|
26
26
|
base = ctx.eval("base")
|
27
27
|
|
28
|
-
@driver.mexpect("if_init_view", ["
|
28
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
29
29
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
30
30
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
31
31
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "my_action"}])
|
@@ -48,7 +48,7 @@ RSpec.describe "kern:controller_spec" do
|
|
48
48
|
|
49
49
|
base = ctx.eval("base")
|
50
50
|
|
51
|
-
@driver.mexpect("if_init_view", ["
|
51
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
52
52
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {"secret" => secret}])
|
53
53
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
54
54
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "my_action"}])
|
@@ -71,12 +71,12 @@ RSpec.describe "kern:controller_spec" do
|
|
71
71
|
|
72
72
|
base = ctx.eval("base")
|
73
73
|
|
74
|
-
@driver.mexpect("if_init_view", ["
|
74
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
75
75
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {"secret" => secret}])
|
76
76
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
77
|
-
@driver.mexpect("if_init_view", ["test_view2", {}, base+5, ["main", "hello", "world"]])
|
78
77
|
|
79
78
|
#We expect the sub controller to receive the same info
|
79
|
+
@driver.mexpect("if_init_view", ["my_sub_controller", {}, base+5, ["main", "hello", "world"]])
|
80
80
|
@driver.mexpect("if_controller_init", [base+4, base+5, "my_sub_controller", {"secret" => secret}])
|
81
81
|
end
|
82
82
|
|
@@ -163,14 +163,14 @@ RSpec.describe "kern:controller_spec" do
|
|
163
163
|
base = ctx.eval('base')
|
164
164
|
|
165
165
|
#First, we expect the base vc to be setup as a view
|
166
|
-
@driver.mexpect("if_init_view", ["
|
166
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
167
167
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
168
168
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
169
169
|
|
170
170
|
#Now we expect the embedded view to be setup as a view within the base view
|
171
171
|
#It's +5, because the base takes us 4 (+3) entries, and then the next embedded takes up
|
172
172
|
#the next view controlelr and finally main view entry (5th)
|
173
|
-
@driver.mexpect("if_init_view", ["
|
173
|
+
@driver.mexpect("if_init_view", ["my_sub_controller", {}, base+5, ["main", "hello", "world"]])
|
174
174
|
@driver.mexpect("if_controller_init", [base+4, base+5, "my_sub_controller", {}])
|
175
175
|
@driver.mexpect("if_attach_view", [base+5, base+2])
|
176
176
|
|
@@ -239,7 +239,7 @@ RSpec.describe "kern:controller_spec" do
|
|
239
239
|
expect(ctx.eval("test_action_called_params")).not_to eq(nil)
|
240
240
|
end
|
241
241
|
|
242
|
-
it
|
242
|
+
it "Can initiate a controller via _embed and have a tracked list of embeds in info" do
|
243
243
|
#Compile the controller
|
244
244
|
ctx = flok_new_user File.read('./spec/kern/assets/controller1.rb')
|
245
245
|
|
@@ -305,12 +305,12 @@ RSpec.describe "kern:controller_spec" do
|
|
305
305
|
#['vc', 'main', 'hello', 'world'], ['vc', 'main']
|
306
306
|
#|--0-----1--------2--------3---|=======================The my_controller
|
307
307
|
# |-4------5---|====== The my_controller2
|
308
|
-
@driver.mexpect("if_init_view", ["
|
308
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
309
309
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
310
310
|
@driver.mexpect("if_attach_view", [base+1, 0]) #Attach to main root spot
|
311
311
|
|
312
312
|
#Embed my_controller2 in action 'my_action'
|
313
|
-
@driver.mexpect("if_init_view", ["
|
313
|
+
@driver.mexpect("if_init_view", ["my_controller2", {}, base+5, ["main"]])
|
314
314
|
@driver.mexpect("if_controller_init", [base+4, base+5, "my_controller2", {}])
|
315
315
|
@driver.mexpect("if_attach_view", [base+5, base+2])
|
316
316
|
|
@@ -377,7 +377,7 @@ RSpec.describe "kern:controller_spec" do
|
|
377
377
|
base = ctx.eval("base")
|
378
378
|
|
379
379
|
#The usual
|
380
|
-
@driver.mexpect("if_init_view", ["
|
380
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main"]])
|
381
381
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
382
382
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
383
383
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "my_action"}])
|
@@ -403,7 +403,7 @@ RSpec.describe "kern:controller_spec" do
|
|
403
403
|
|
404
404
|
base = ctx.eval("base")
|
405
405
|
|
406
|
-
@driver.mexpect("if_init_view", ["
|
406
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "content"]])
|
407
407
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
408
408
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
409
409
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "my_action"}])
|
@@ -428,7 +428,7 @@ RSpec.describe "kern:controller_spec" do
|
|
428
428
|
|
429
429
|
base = ctx.eval("base")
|
430
430
|
|
431
|
-
@driver.mexpect("if_init_view", ["
|
431
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "hello", "world"]])
|
432
432
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
433
433
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
434
434
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "my_action"}])
|
data/spec/kern/debug_spec.rb
CHANGED
@@ -9,9 +9,10 @@ require './spec/lib/rspec_extensions.rb'
|
|
9
9
|
RSpec.describe "kern:debug_spec" do
|
10
10
|
include_context "kern"
|
11
11
|
|
12
|
-
|
12
|
+
#includes context, events, etc.
|
13
|
+
it "Can retreive the controller's describe" do
|
13
14
|
#Compile the controller
|
14
|
-
ctx = flok_new_user File.read('./spec/kern/assets/
|
15
|
+
ctx = flok_new_user File.read('./spec/kern/assets/controller_describe.rb')
|
15
16
|
|
16
17
|
#Do not run anything
|
17
18
|
ctx.eval %{
|
@@ -24,15 +25,20 @@ RSpec.describe "kern:debug_spec" do
|
|
24
25
|
|
25
26
|
base = ctx.eval("base")
|
26
27
|
|
27
|
-
@driver.mexpect("if_init_view", ["
|
28
|
+
@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main"]])
|
28
29
|
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {"hello" => "world"}])
|
29
30
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
30
31
|
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
31
32
|
|
32
33
|
#Request context for view controller
|
33
|
-
@driver.int "
|
34
|
-
@driver.mexpect("if_event", [-333, "
|
35
|
-
"
|
34
|
+
@driver.int "int_debug_controller_describe", [base]
|
35
|
+
@driver.mexpect("if_event", [-333, "debug_controller_describe_res", {
|
36
|
+
"context" => {
|
37
|
+
"hello" => "world"
|
38
|
+
},
|
39
|
+
"events" => [
|
40
|
+
"test"
|
41
|
+
]
|
36
42
|
}])
|
37
43
|
end
|
38
44
|
end
|
data/spec/kern/debug_ui_spec.rb
CHANGED
@@ -9,139 +9,273 @@ require './spec/lib/rspec_extensions.rb'
|
|
9
9
|
RSpec.describe "kern:debug_ui_spec" do
|
10
10
|
include_context "kern"
|
11
11
|
|
12
|
-
it "Can call int_debug_dump_ui and get back root view hierarchy" do
|
12
|
+
#it "Can call int_debug_dump_ui and get back root view hierarchy" do
|
13
|
+
##Compile the controller
|
14
|
+
#ctx = flok_new_user File.read('./spec/kern/assets/controller_bare.rb')
|
15
|
+
|
16
|
+
##Do not run anything
|
17
|
+
#ctx.eval %{
|
18
|
+
#int_dispatch([]);
|
19
|
+
#}
|
20
|
+
|
21
|
+
#@driver.int "int_debug_dump_ui", []
|
22
|
+
|
23
|
+
#@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
24
|
+
#"type" => "spot",
|
25
|
+
#"name" => "root",
|
26
|
+
#"ptr" => 0,
|
27
|
+
#"children" => []
|
28
|
+
#}])
|
29
|
+
#end
|
30
|
+
|
31
|
+
#it "Can call int_debug_dump_ui for one controller correctly" do
|
32
|
+
##Compile the controller
|
33
|
+
#ctx = flok_new_user File.read('./spec/kern/assets/controller_bare.rb')
|
34
|
+
|
35
|
+
##Do not run anything
|
36
|
+
#ctx.eval %{
|
37
|
+
#//Call embed on main root view
|
38
|
+
#base = _embed("my_controller", 0, {}, null);
|
39
|
+
|
40
|
+
#//Drain queue
|
41
|
+
#int_dispatch([]);
|
42
|
+
#}
|
43
|
+
|
44
|
+
#base = ctx.eval("base")
|
45
|
+
|
46
|
+
#@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main"]])
|
47
|
+
#@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
48
|
+
#@driver.mexpect("if_attach_view", [base+1, 0])
|
49
|
+
#@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
50
|
+
|
51
|
+
#@driver.int "int_debug_dump_ui", []
|
52
|
+
#@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
53
|
+
#"type" => "spot",
|
54
|
+
#"name" => "root",
|
55
|
+
#"ptr" => 0,
|
56
|
+
#"children" => [
|
57
|
+
#{
|
58
|
+
#"name" => "my_controller",
|
59
|
+
#"ptr" => base,
|
60
|
+
#"type" => "vc",
|
61
|
+
#"action" => "index",
|
62
|
+
#"events" => ["test"],
|
63
|
+
#"children" => [
|
64
|
+
#{
|
65
|
+
#"type" => "view",
|
66
|
+
#"name" => "my_controller",
|
67
|
+
#"ptr" => base+1,
|
68
|
+
#"children" => []
|
69
|
+
#}
|
70
|
+
#]
|
71
|
+
#}
|
72
|
+
#]
|
73
|
+
#}])
|
74
|
+
#end
|
75
|
+
|
76
|
+
#it "Can call int_debug_dump_ui for one controller correctly with spots" do
|
77
|
+
##Compile the controller
|
78
|
+
#ctx = flok_new_user File.read('./spec/kern/assets/controller_spots.rb')
|
79
|
+
|
80
|
+
##Do not run anything
|
81
|
+
#ctx.eval %{
|
82
|
+
#//Call embed on main root view
|
83
|
+
#base = _embed("my_controller", 0, {}, null);
|
84
|
+
|
85
|
+
#//Drain queue
|
86
|
+
#int_dispatch([]);
|
87
|
+
#}
|
88
|
+
|
89
|
+
#base = ctx.eval("base")
|
90
|
+
|
91
|
+
#@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "one", "two"]])
|
92
|
+
#@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
93
|
+
#@driver.mexpect("if_attach_view", [base+1, 0])
|
94
|
+
#@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
95
|
+
|
96
|
+
#@driver.int "int_debug_dump_ui", []
|
97
|
+
#@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
98
|
+
#"type" => "spot",
|
99
|
+
#"name" => "root",
|
100
|
+
#"ptr" => 0,
|
101
|
+
#"children" => [
|
102
|
+
#{
|
103
|
+
#"name" => "my_controller",
|
104
|
+
#"ptr" => base,
|
105
|
+
#"type" => "vc",
|
106
|
+
#"action" => "index",
|
107
|
+
#"events" => ["test", "test2"],
|
108
|
+
#"children" => [
|
109
|
+
#{
|
110
|
+
#"type" => "view",
|
111
|
+
#"name" => "my_controller",
|
112
|
+
#"ptr" => base+1,
|
113
|
+
#"children" => [
|
114
|
+
#{"name" => "one", "type" => "spot", "children" => [], "ptr" => base+2},
|
115
|
+
#{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
116
|
+
#]
|
117
|
+
#}
|
118
|
+
#]
|
119
|
+
#}
|
120
|
+
#]
|
121
|
+
#}])
|
122
|
+
#end
|
123
|
+
|
124
|
+
#it "Can call int_debug_dump_ui for one controller correctly with spots and one embedded" do
|
125
|
+
##Compile the controller
|
126
|
+
#ctx = flok_new_user File.read('./spec/kern/assets/controller_spots_embed.rb')
|
127
|
+
|
128
|
+
##Do not run anything
|
129
|
+
#ctx.eval %{
|
130
|
+
#//Call embed on main root view
|
131
|
+
#base = _embed("my_controller", 0, {}, null);
|
132
|
+
|
133
|
+
#//Drain queue
|
134
|
+
#int_dispatch([]);
|
135
|
+
#}
|
136
|
+
|
137
|
+
#base = ctx.eval("base")
|
138
|
+
|
139
|
+
#@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "one", "two"]])
|
140
|
+
#@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
141
|
+
#@driver.mexpect("if_attach_view", [base+1, 0])
|
142
|
+
#@driver.mexpect("if_init_view", ["my_other_controller", {}, base+5, ["main"]])
|
143
|
+
#@driver.mexpect("if_controller_init", [base+4, base+5, "my_other_controller", {}])
|
144
|
+
#@driver.mexpect("if_attach_view", [base+5, base+2])
|
145
|
+
#@driver.mexpect("if_event", [base+4, "action", {"from" => nil, "to" => "index"}])
|
146
|
+
#@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
147
|
+
|
148
|
+
#@driver.int "int_debug_dump_ui", []
|
149
|
+
#@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
150
|
+
#"type" => "spot",
|
151
|
+
#"name" => "root",
|
152
|
+
#"ptr" => 0,
|
153
|
+
#"children" => [
|
154
|
+
#{
|
155
|
+
#"name" => "my_controller",
|
156
|
+
#"ptr" => base,
|
157
|
+
#"type" => "vc",
|
158
|
+
#"action" => "index",
|
159
|
+
#"events" => ["test1"],
|
160
|
+
#"children" => [
|
161
|
+
#{
|
162
|
+
#"type" => "view",
|
163
|
+
#"name" => "my_controller",
|
164
|
+
#"ptr" => base+1,
|
165
|
+
#"children" => [
|
166
|
+
#{"name" => "one", "type" => "spot", "children" => [
|
167
|
+
#{
|
168
|
+
#"name" => "my_other_controller",
|
169
|
+
#"ptr" => base+4,
|
170
|
+
#"type" => "vc",
|
171
|
+
#"action" => "index",
|
172
|
+
#"events" => ["test2"],
|
173
|
+
#"children" => [
|
174
|
+
#{
|
175
|
+
#"type" => "view",
|
176
|
+
#"ptr" => base+5,
|
177
|
+
#"name" => "my_other_controller",
|
178
|
+
#"children" => [],
|
179
|
+
#}
|
180
|
+
#]
|
181
|
+
#}
|
182
|
+
#], "ptr" => base+2},
|
183
|
+
#{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
184
|
+
#]
|
185
|
+
#}
|
186
|
+
#]
|
187
|
+
#}
|
188
|
+
#]
|
189
|
+
#}])
|
190
|
+
#end
|
191
|
+
|
192
|
+
#it "Can call int_debug_dump_ui for one controller correctly with spots and one embedded that was later removed" do
|
193
|
+
##Compile the controller
|
194
|
+
#ctx = flok_new_user File.read('./spec/kern/assets/controller_spots_embed_removed.rb')
|
195
|
+
|
196
|
+
##Do not run anything
|
197
|
+
#ctx.eval %{
|
198
|
+
#//Call embed on main root view
|
199
|
+
#base = _embed("my_controller", 0, {}, null);
|
200
|
+
|
201
|
+
#//Drain queue
|
202
|
+
#int_dispatch([3, "int_event", base, "next", {}]);
|
203
|
+
#}
|
204
|
+
|
205
|
+
#base = ctx.eval("base")
|
206
|
+
|
207
|
+
#@driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main", "one", "two"]])
|
208
|
+
#@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
209
|
+
#@driver.mexpect("if_attach_view", [base+1, 0])
|
210
|
+
#@driver.mexpect("if_init_view", ["my_other_controller", {}, base+5, ["main"]])
|
211
|
+
#@driver.mexpect("if_controller_init", [base+4, base+5, "my_other_controller", {}])
|
212
|
+
#@driver.mexpect("if_attach_view", [base+5, base+2])
|
213
|
+
#@driver.mexpect("if_event", [base+4, "action", {"from" => nil, "to" => "index"}])
|
214
|
+
#@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
215
|
+
|
216
|
+
##Expect the view to be removed, and for our action to switch
|
217
|
+
#@driver.mexpect("if_free_view", [base+5])
|
218
|
+
#@driver.mexpect("if_event", [base, "action", {"from" => "index", "to" => "other"}])
|
219
|
+
|
220
|
+
#@driver.int "int_debug_dump_ui", []
|
221
|
+
#@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
222
|
+
#"type" => "spot",
|
223
|
+
#"name" => "root",
|
224
|
+
#"ptr" => 0,
|
225
|
+
#"children" => [
|
226
|
+
#{
|
227
|
+
#"name" => "my_controller",
|
228
|
+
#"events" => ["test2"],
|
229
|
+
#"ptr" => base,
|
230
|
+
#"type" => "vc",
|
231
|
+
#"action" => "other",
|
232
|
+
#"children" => [
|
233
|
+
#{
|
234
|
+
#"type" => "view",
|
235
|
+
#"name" => "my_controller",
|
236
|
+
#"ptr" => base+1,
|
237
|
+
#"children" => [
|
238
|
+
#{"name" => "one", "type" => "spot", "children" => [], "ptr" => base+2},
|
239
|
+
#{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
240
|
+
#]
|
241
|
+
#}
|
242
|
+
#]
|
243
|
+
#}
|
244
|
+
#]
|
245
|
+
#}])
|
246
|
+
#end
|
247
|
+
|
248
|
+
it "Can go forward and then back and have the correct hierarchy (where a parent controlls children like nav)" do
|
13
249
|
#Compile the controller
|
14
|
-
ctx = flok_new_user File.read('./spec/kern/assets/
|
15
|
-
|
16
|
-
#Do not run anything
|
17
|
-
ctx.eval %{
|
18
|
-
int_dispatch([]);
|
19
|
-
}
|
20
|
-
|
21
|
-
@driver.int "int_debug_dump_ui", []
|
22
|
-
|
23
|
-
@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
24
|
-
"type" => "spot",
|
25
|
-
"name" => "root",
|
26
|
-
"ptr" => 0,
|
27
|
-
"children" => []
|
28
|
-
}])
|
29
|
-
end
|
30
|
-
|
31
|
-
it "Can call int_debug_dump_ui for one controller correctly" do
|
32
|
-
#Compile the controller
|
33
|
-
ctx = flok_new_user File.read('./spec/kern/assets/controller_bare.rb')
|
34
|
-
|
35
|
-
#Do not run anything
|
36
|
-
ctx.eval %{
|
37
|
-
//Call embed on main root view
|
38
|
-
base = _embed("my_controller", 0, {}, null);
|
39
|
-
|
40
|
-
//Drain queue
|
41
|
-
int_dispatch([]);
|
42
|
-
}
|
43
|
-
|
44
|
-
base = ctx.eval("base")
|
45
|
-
|
46
|
-
@driver.mexpect("if_init_view", ["my_view", {}, base+1, ["main"]])
|
47
|
-
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
48
|
-
@driver.mexpect("if_attach_view", [base+1, 0])
|
49
|
-
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
50
|
-
|
51
|
-
@driver.int "int_debug_dump_ui", []
|
52
|
-
@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
53
|
-
"type" => "spot",
|
54
|
-
"name" => "root",
|
55
|
-
"ptr" => 0,
|
56
|
-
"children" => [
|
57
|
-
{
|
58
|
-
"name" => "my_controller",
|
59
|
-
"ptr" => base,
|
60
|
-
"type" => "vc",
|
61
|
-
"action" => "index",
|
62
|
-
"children" => [
|
63
|
-
{
|
64
|
-
"type" => "view",
|
65
|
-
"name" => "my_view",
|
66
|
-
"ptr" => base+1,
|
67
|
-
"children" => []
|
68
|
-
}
|
69
|
-
]
|
70
|
-
}
|
71
|
-
]
|
72
|
-
}])
|
73
|
-
end
|
74
|
-
|
75
|
-
it "Can call int_debug_dump_ui for one controller correctly with spots" do
|
76
|
-
#Compile the controller
|
77
|
-
ctx = flok_new_user File.read('./spec/kern/assets/controller_spots.rb')
|
250
|
+
ctx = flok_new_user File.read('./spec/kern/assets/forward_and_back.rb')
|
78
251
|
|
79
252
|
#Do not run anything
|
80
253
|
ctx.eval %{
|
81
254
|
//Call embed on main root view
|
82
|
-
base = _embed("
|
255
|
+
base = _embed("fabric", 0, {}, null);
|
83
256
|
|
84
257
|
//Drain queue
|
85
|
-
int_dispatch([]);
|
258
|
+
int_dispatch([3, "int_event", base, "next_clicked", {}]);
|
86
259
|
}
|
87
260
|
|
88
261
|
base = ctx.eval("base")
|
89
262
|
|
90
|
-
@driver.mexpect("if_init_view", ["
|
91
|
-
@driver.mexpect("if_controller_init", [base, base+1, "
|
263
|
+
@driver.mexpect("if_init_view", ["fabric", {}, base+1, ["main", "content"]])
|
264
|
+
@driver.mexpect("if_controller_init", [base, base+1, "fabric", {}])
|
92
265
|
@driver.mexpect("if_attach_view", [base+1, 0])
|
93
|
-
@driver.mexpect("
|
94
|
-
|
95
|
-
@driver.
|
96
|
-
@driver.mexpect("if_event", [
|
97
|
-
|
98
|
-
"name" => "root",
|
99
|
-
"ptr" => 0,
|
100
|
-
"children" => [
|
101
|
-
{
|
102
|
-
"name" => "my_controller",
|
103
|
-
"ptr" => base,
|
104
|
-
"type" => "vc",
|
105
|
-
"action" => "index",
|
106
|
-
"children" => [
|
107
|
-
{
|
108
|
-
"type" => "view",
|
109
|
-
"name" => "my_view",
|
110
|
-
"ptr" => base+1,
|
111
|
-
"children" => [
|
112
|
-
{"name" => "one", "type" => "spot", "children" => [], "ptr" => base+2},
|
113
|
-
{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
114
|
-
]
|
115
|
-
}
|
116
|
-
]
|
117
|
-
}
|
118
|
-
]
|
119
|
-
}])
|
120
|
-
end
|
121
|
-
|
122
|
-
it "Can call int_debug_dump_ui for one controller correctly with spots and one embedded" do
|
123
|
-
#Compile the controller
|
124
|
-
ctx = flok_new_user File.read('./spec/kern/assets/controller_spots_embed.rb')
|
125
|
-
|
126
|
-
#Do not run anything
|
127
|
-
ctx.eval %{
|
128
|
-
//Call embed on main root view
|
129
|
-
base = _embed("my_controller", 0, {}, null);
|
130
|
-
|
131
|
-
//Drain queue
|
132
|
-
int_dispatch([]);
|
133
|
-
}
|
266
|
+
@driver.mexpect("if_init_view", ["one", {}, base+4, ["main"]])
|
267
|
+
@driver.mexpect("if_controller_init", [base+3, base+4, "one", {}])
|
268
|
+
@driver.mexpect("if_attach_view", [base+4, base+2])
|
269
|
+
@driver.mexpect("if_event", [base+3, "action", {"from" => nil, "to" => "index"}])
|
270
|
+
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "one"}])
|
134
271
|
|
135
|
-
|
136
|
-
|
137
|
-
@driver.mexpect("if_init_view", ["
|
138
|
-
@driver.mexpect("if_controller_init", [base, base+
|
139
|
-
@driver.mexpect("if_attach_view", [base+
|
140
|
-
@driver.mexpect("
|
141
|
-
@driver.mexpect("
|
142
|
-
@driver.mexpect("if_attach_view", [base+5, base+2])
|
143
|
-
@driver.mexpect("if_event", [base+4, "action", {"from" => nil, "to" => "index"}])
|
144
|
-
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
272
|
+
#Expect the view to be removed, and for our action to switch
|
273
|
+
@driver.mexpect("if_free_view", [base+4])
|
274
|
+
@driver.mexpect("if_init_view", ["two", {}, base+6, ["main"]])
|
275
|
+
@driver.mexpect("if_controller_init", [base+5, base+6, "two", {}])
|
276
|
+
@driver.mexpect("if_attach_view", [base+6, base+2])
|
277
|
+
@driver.mexpect("if_event", [base+5, "action", {"from" => nil, "to" => "index"}])
|
278
|
+
@driver.mexpect("if_event", [base, "action", {"from" => "one", "to" => "two"}])
|
145
279
|
|
146
280
|
@driver.int "int_debug_dump_ui", []
|
147
281
|
@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
@@ -150,88 +284,34 @@ it "Can call int_debug_dump_ui and get back root view hierarchy" do
|
|
150
284
|
"ptr" => 0,
|
151
285
|
"children" => [
|
152
286
|
{
|
153
|
-
"name" => "
|
287
|
+
"name" => "fabric",
|
288
|
+
"events" => ["back_clicked"],
|
154
289
|
"ptr" => base,
|
155
290
|
"type" => "vc",
|
156
|
-
"action" => "
|
291
|
+
"action" => "two",
|
157
292
|
"children" => [
|
158
293
|
{
|
159
294
|
"type" => "view",
|
160
|
-
"name" => "
|
295
|
+
"name" => "fabric",
|
161
296
|
"ptr" => base+1,
|
162
297
|
"children" => [
|
163
|
-
{"name" => "
|
298
|
+
{"name" => "content", "type" => "spot", "ptr" => base+2, "children" => [
|
164
299
|
{
|
165
|
-
"name" => "
|
166
|
-
"
|
300
|
+
"name" => "two",
|
301
|
+
"events" => [],
|
167
302
|
"type" => "vc",
|
168
303
|
"action" => "index",
|
304
|
+
"ptr" => base+5,
|
169
305
|
"children" => [
|
170
306
|
{
|
171
307
|
"type" => "view",
|
172
|
-
"
|
173
|
-
"
|
174
|
-
"children" => []
|
308
|
+
"name" => "two",
|
309
|
+
"ptr" => base+6,
|
310
|
+
"children" => []
|
175
311
|
}
|
176
312
|
]
|
177
313
|
}
|
178
|
-
]
|
179
|
-
{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
180
|
-
]
|
181
|
-
}
|
182
|
-
]
|
183
|
-
}
|
184
|
-
]
|
185
|
-
}])
|
186
|
-
end
|
187
|
-
|
188
|
-
it "Can call int_debug_dump_ui for one controller correctly with spots and one embedded that was later removed" do
|
189
|
-
#Compile the controller
|
190
|
-
ctx = flok_new_user File.read('./spec/kern/assets/controller_spots_embed_removed.rb')
|
191
|
-
|
192
|
-
#Do not run anything
|
193
|
-
ctx.eval %{
|
194
|
-
//Call embed on main root view
|
195
|
-
base = _embed("my_controller", 0, {}, null);
|
196
|
-
|
197
|
-
//Drain queue
|
198
|
-
int_dispatch([3, "int_event", base, "next", {}]);
|
199
|
-
}
|
200
|
-
|
201
|
-
base = ctx.eval("base")
|
202
|
-
|
203
|
-
@driver.mexpect("if_init_view", ["my_view", {}, base+1, ["main", "one", "two"]])
|
204
|
-
@driver.mexpect("if_controller_init", [base, base+1, "my_controller", {}])
|
205
|
-
@driver.mexpect("if_attach_view", [base+1, 0])
|
206
|
-
@driver.mexpect("if_init_view", ["my_other_view", {}, base+5, ["main"]])
|
207
|
-
@driver.mexpect("if_controller_init", [base+4, base+5, "my_other_controller", {}])
|
208
|
-
@driver.mexpect("if_attach_view", [base+5, base+2])
|
209
|
-
@driver.mexpect("if_event", [base+4, "action", {"from" => nil, "to" => "index"}])
|
210
|
-
@driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])
|
211
|
-
|
212
|
-
#Expect the view to be removed, and for our action to switch
|
213
|
-
@driver.mexpect("if_free_view", [base+5])
|
214
|
-
@driver.mexpect("if_event", [base, "action", {"from" => "index", "to" => "other"}])
|
215
|
-
|
216
|
-
@driver.int "int_debug_dump_ui", []
|
217
|
-
@driver.mexpect("if_event", [-333, "debug_dump_ui_res", {
|
218
|
-
"type" => "spot",
|
219
|
-
"name" => "root",
|
220
|
-
"ptr" => 0,
|
221
|
-
"children" => [
|
222
|
-
{
|
223
|
-
"name" => "my_controller",
|
224
|
-
"ptr" => base,
|
225
|
-
"type" => "vc",
|
226
|
-
"action" => "other",
|
227
|
-
"children" => [
|
228
|
-
{
|
229
|
-
"type" => "view",
|
230
|
-
"name" => "my_view",
|
231
|
-
"ptr" => base+1,
|
232
|
-
"children" => [
|
233
|
-
{"name" => "one", "type" => "spot", "children" => [], "ptr" => base+2},
|
234
|
-
{"name" => "two", "type" => "spot", "children" => [], "ptr" => base+3},
|
314
|
+
]}
|
235
315
|
]
|
236
316
|
}
|
237
317
|
]
|