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 const int timeout_ms = 5 * TestTimeouts::action_max_timeout_ms(); |
Paweł Hajdan Jr.
2011/01/17 08:19:32
Ouch, this multiplication is bad. Could you find a
tfarina
2011/01/17 12:14:46
The closest is live_operation_timeout_ms(), which
Paweł Hajdan Jr.
2011/01/17 14:58:03
No, live_operation_timeout is meant for code that
tfarina
2011/01/19 12:30:40
Done.
| |
62 | 63 |
63 // Wait for the onload() handler to complete so we can do the | 64 // Wait for the onload() handler to complete so we can do the |
64 // next part of the test. | 65 // next part of the test. |
65 ASSERT_TRUE(WaitUntilCookieValue( | 66 ASSERT_TRUE(WaitUntilCookieValue( |
66 tab.get(), test_url, "__state", timeout_ms, "initial")); | 67 tab.get(), test_url, "__state", timeout_ms, "initial")); |
67 | 68 |
68 // Move the cursor to the top-center of the content, which will trigger | 69 // Move the cursor to the top-center of the content, which will trigger |
69 // a javascript onMouseOver event. | 70 // a javascript onMouseOver event. |
70 ASSERT_TRUE(window->SimulateOSMouseMove(in_content_point)); | 71 ASSERT_TRUE(window->SimulateOSMouseMove(in_content_point)); |
71 | 72 |
72 // Wait on the correct intermediate value of the cookie. | 73 // Wait on the correct intermediate value of the cookie. |
73 ASSERT_TRUE(WaitUntilCookieValue( | 74 ASSERT_TRUE(WaitUntilCookieValue( |
74 tab.get(), test_url, "__state", timeout_ms, "initial,entered")); | 75 tab.get(), test_url, "__state", 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", timeout_ms, "initial,entered,left")); |
83 } | 84 } |
84 | 85 |
85 } // namespace | 86 } // namespace |
OLD | NEW |