@@ -160,29 +160,36 @@ public List<BrowsingContextInfo> getTopLevelContexts() {
160160 new Command <>("browsingContext.getTree" , new HashMap <>(), browsingContextInfoListMapper ));
161161 }
162162
163- // Yet to be implemented by browser vendors
164- private void reload () {
165- this .bidi .send (new Command <>(RELOAD , ImmutableMap .of (CONTEXT , id )));
163+ public NavigationResult reload () {
164+ return this .bidi .send (new Command <>(RELOAD , ImmutableMap .of (CONTEXT , id ), navigationInfoMapper ));
166165 }
167166
168167 // Yet to be implemented by browser vendors
169- private void reload (boolean ignoreCache ) {
170- this .bidi .send (new Command <>(RELOAD , ImmutableMap .of (CONTEXT , id , "ignoreCache" , ignoreCache )));
168+ private NavigationResult reload (boolean ignoreCache ) {
169+ return this .bidi .send (new Command <>(
170+ RELOAD ,
171+ ImmutableMap .of (CONTEXT , id , "ignoreCache" , ignoreCache ),
172+ navigationInfoMapper ));
171173 }
172174
173- // Yet to be implemented by browser vendors
174- private void reload (ReadinessState readinessState ) {
175- this .bidi .send (
176- new Command <>(RELOAD , ImmutableMap .of (CONTEXT , id , "wait" , readinessState .toString ())));
175+ // TODO: Handle timeouts in case of Readiness state "interactive" and "complete".
176+ // Refer https://github.com/w3c/webdriver-bidi/issues/188
177+ public NavigationResult reload (ReadinessState readinessState ) {
178+ return this .bidi .send (
179+ new Command <>(
180+ RELOAD ,
181+ ImmutableMap .of (CONTEXT , id , "wait" , readinessState .toString ()),
182+ navigationInfoMapper ));
177183 }
178184
179185 // Yet to be implemented by browser vendors
180- private void reload (boolean ignoreCache , ReadinessState readinessState ) {
181- this .bidi .send (
186+ private NavigationResult reload (boolean ignoreCache , ReadinessState readinessState ) {
187+ return this .bidi .send (
182188 new Command <>(
183189 RELOAD ,
184190 ImmutableMap .of (
185- CONTEXT , id , "ignoreCache" , ignoreCache , "wait" , readinessState .toString ())));
191+ CONTEXT , id , "ignoreCache" , ignoreCache , "wait" , readinessState .toString ()),
192+ navigationInfoMapper ));
186193 }
187194
188195 // Yet to be implemented by browser vendors
0 commit comments