| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/test/test_timeouts.h" |
| 6 #include "chrome/test/automation/browser_proxy.h" | 7 #include "chrome/test/automation/browser_proxy.h" |
| 7 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
| 8 #include "chrome/test/automation/window_proxy.h" | 9 #include "chrome/test/automation/window_proxy.h" |
| 9 #include "chrome/test/ui/ui_test.h" | 10 #include "chrome/test/ui/ui_test.h" |
| 10 #include "chrome/test/ui_test_utils.h" | 11 #include "chrome/test/ui_test_utils.h" |
| 11 #include "gfx/point.h" | 12 #include "gfx/point.h" |
| 12 #include "gfx/rect.h" | 13 #include "gfx/rect.h" |
| 13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 gfx::Point above_content_point( | 52 gfx::Point above_content_point( |
| 52 tab_view_bounds.x() + tab_view_bounds.width() / 2, | 53 tab_view_bounds.x() + tab_view_bounds.width() / 2, |
| 53 tab_view_bounds.y() - 2); | 54 tab_view_bounds.y() - 2); |
| 54 | 55 |
| 55 // Start by moving the point just above the content. | 56 // Start by moving the point just above the content. |
| 56 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point)); | 57 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point)); |
| 57 | 58 |
| 58 // Navigate to the test html page. | 59 // Navigate to the test html page. |
| 59 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); | 60 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url)); |
| 60 | 61 |
| 61 const int timeout_ms = 5 * action_max_timeout_ms(); | |
| 62 | |
| 63 // Wait for the onload() handler to complete so we can do the | 62 // Wait for the onload() handler to complete so we can do the |
| 64 // next part of the test. | 63 // next part of the test. |
| 65 ASSERT_TRUE(WaitUntilCookieValue( | 64 ASSERT_TRUE(WaitUntilCookieValue( |
| 66 tab.get(), test_url, "__state", timeout_ms, "initial")); | 65 tab.get(), test_url, "__state", |
| 66 TestTimeouts::large_test_timeout_ms(), "initial")); |
| 67 | 67 |
| 68 // Move the cursor to the top-center of the content, which will trigger | 68 // Move the cursor to the top-center of the content, which will trigger |
| 69 // a javascript onMouseOver event. | 69 // a javascript onMouseOver event. |
| 70 ASSERT_TRUE(window->SimulateOSMouseMove(in_content_point)); | 70 ASSERT_TRUE(window->SimulateOSMouseMove(in_content_point)); |
| 71 | 71 |
| 72 // Wait on the correct intermediate value of the cookie. | 72 // Wait on the correct intermediate value of the cookie. |
| 73 ASSERT_TRUE(WaitUntilCookieValue( | 73 ASSERT_TRUE(WaitUntilCookieValue( |
| 74 tab.get(), test_url, "__state", timeout_ms, "initial,entered")); | 74 tab.get(), test_url, "__state", |
| 75 TestTimeouts::large_test_timeout_ms(), "initial,entered")); |
| 75 | 76 |
| 76 // Move the cursor above the content again, which should trigger | 77 // Move the cursor above the content again, which should trigger |
| 77 // a javascript onMouseOut event. | 78 // a javascript onMouseOut event. |
| 78 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point)); | 79 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point)); |
| 79 | 80 |
| 80 // Wait on the correct final value of the cookie. | 81 // Wait on the correct final value of the cookie. |
| 81 ASSERT_TRUE(WaitUntilCookieValue( | 82 ASSERT_TRUE(WaitUntilCookieValue( |
| 82 tab.get(), test_url, "__state", timeout_ms, "initial,entered,left")); | 83 tab.get(), test_url, "__state", |
| 84 TestTimeouts::large_test_timeout_ms(), "initial,entered,left")); |
| 83 } | 85 } |
| 84 | 86 |
| 85 } // namespace | 87 } // namespace |
| OLD | NEW |