| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/touch_editable_impl_aura.h" | 5 #include "content/browser/web_contents/touch_editable_impl_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 public: | 118 public: |
| 119 TouchEditableImplAuraTest() {} | 119 TouchEditableImplAuraTest() {} |
| 120 | 120 |
| 121 protected: | 121 protected: |
| 122 void SetUpOnMainThread() override { | 122 void SetUpOnMainThread() override { |
| 123 ContentBrowserTest::SetUpOnMainThread(); | 123 ContentBrowserTest::SetUpOnMainThread(); |
| 124 aura::client::SetScreenPositionClient(shell()->window()->GetRootWindow(), | 124 aura::client::SetScreenPositionClient(shell()->window()->GetRootWindow(), |
| 125 &screen_position_client_); | 125 &screen_position_client_); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void SetUpCommandLine(CommandLine* command_line) override { | 128 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 129 command_line->AppendSwitch(switches::kEnableTouchEditing); | 129 command_line->AppendSwitch(switches::kEnableTouchEditing); |
| 130 } | 130 } |
| 131 | 131 |
| 132 // Executes the javascript synchronously and makes sure the returned value is | 132 // Executes the javascript synchronously and makes sure the returned value is |
| 133 // freed properly. | 133 // freed properly. |
| 134 void ExecuteSyncJSFunction(RenderFrameHost* rfh, const std::string& jscript) { | 134 void ExecuteSyncJSFunction(RenderFrameHost* rfh, const std::string& jscript) { |
| 135 scoped_ptr<base::Value> value = | 135 scoped_ptr<base::Value> value = |
| 136 content::ExecuteScriptAndGetValue(rfh, jscript); | 136 content::ExecuteScriptAndGetValue(rfh, jscript); |
| 137 } | 137 } |
| 138 | 138 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 value = content::ExecuteScriptAndGetValue(main_frame, | 459 value = content::ExecuteScriptAndGetValue(main_frame, |
| 460 "get_cursor_position()"); | 460 "get_cursor_position()"); |
| 461 int new_cursor_pos = -1; | 461 int new_cursor_pos = -1; |
| 462 value->GetAsInteger(&new_cursor_pos); | 462 value->GetAsInteger(&new_cursor_pos); |
| 463 EXPECT_NE(-1, new_cursor_pos); | 463 EXPECT_NE(-1, new_cursor_pos); |
| 464 // Cursor should have moved. | 464 // Cursor should have moved. |
| 465 EXPECT_NE(new_cursor_pos, cursor_pos); | 465 EXPECT_NE(new_cursor_pos, cursor_pos); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace content | 468 } // namespace content |
| OLD | NEW |