| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/public/test/web_view_interaction_test_util.h" | 5 #import "ios/web/public/test/web_view_interaction_test_util.h" |
| 6 | 6 |
| 7 #import "base/mac/bind_objc_block.h" | 7 #import "base/mac/bind_objc_block.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #import "base/test/ios/wait_util.h" | 10 #import "base/test/ios/wait_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 // As result is marked __block, this return call does a copy and not a move | 47 // As result is marked __block, this return call does a copy and not a move |
| 48 // (marking the variable as __block mean it is allocated in the block object | 48 // (marking the variable as __block mean it is allocated in the block object |
| 49 // and not the stack). Since the "return std::move()" pattern is discouraged | 49 // and not the stack). Since the "return std::move()" pattern is discouraged |
| 50 // use a local variable. | 50 // use a local variable. |
| 51 // | 51 // |
| 52 // Fixes the following compilation failure: | 52 // Fixes the following compilation failure: |
| 53 // ../web_view_matchers.mm:ll:cc: error: call to implicitly-deleted copy | 53 // ../web_view_matchers.mm:ll:cc: error: call to implicitly-deleted copy |
| 54 // constructor of 'std::unique_ptr<base::Value>' | 54 // constructor of 'std::unique_ptr<base::Value>' |
| 55 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
| 55 std::unique_ptr<base::Value> stack_result = std::move(result); | 56 std::unique_ptr<base::Value> stack_result = std::move(result); |
| 56 return stack_result; | 57 return stack_result; |
| 57 } | 58 } |
| 58 | 59 |
| 59 CGRect GetBoundingRectOfElementWithId(web::WebState* web_state, | 60 CGRect GetBoundingRectOfElementWithId(web::WebState* web_state, |
| 60 const std::string& element_id) { | 61 const std::string& element_id) { |
| 61 std::string kGetBoundsScript = | 62 std::string kGetBoundsScript = |
| 62 "(function() {" | 63 "(function() {" |
| 63 " var element = document.getElementById('" + | 64 " var element = document.getElementById('" + |
| 64 element_id + | 65 element_id + |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 168 } |
| 168 | 169 |
| 169 bool SubmitWebViewFormWithId(web::WebState* web_state, | 170 bool SubmitWebViewFormWithId(web::WebState* web_state, |
| 170 const std::string& form_id) { | 171 const std::string& form_id) { |
| 171 return RunActionOnWebViewElementWithId(web_state, form_id, | 172 return RunActionOnWebViewElementWithId(web_state, form_id, |
| 172 ELEMENT_ACTION_SUBMIT); | 173 ELEMENT_ACTION_SUBMIT); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace test | 176 } // namespace test |
| 176 } // namespace web | 177 } // namespace web |
| OLD | NEW |