Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: chrome/test/interactive_ui/mouseleave_interactive_uitest.cc

Issue 7568002: Move more files from chrome/test to chrome/test/base, part #6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/file_path.h"
6 #include "base/test/test_timeouts.h"
7 #include "chrome/test/automation/automation_proxy.h"
8 #include "chrome/test/automation/browser_proxy.h"
9 #include "chrome/test/automation/tab_proxy.h"
10 #include "chrome/test/automation/window_proxy.h"
11 #include "chrome/test/base/ui_test_utils.h"
12 #include "chrome/test/ui/ui_test.h"
13 #include "googleurl/src/gurl.h"
14 #include "ui/gfx/point.h"
15 #include "ui/gfx/rect.h"
16
17 namespace {
18
19 class MouseLeaveTest : public UITest {
20 public:
21 MouseLeaveTest() {
22 dom_automation_enabled_ = true;
23 show_window_ = true;
24 }
25
26 DISALLOW_COPY_AND_ASSIGN(MouseLeaveTest);
27 };
28
29 #if defined(OS_MACOSX)
30 // Missing automation provider support: http://crbug.com/45892
31 #define MAYBE_TestOnMouseOut DISABLED_TestOnMouseOut
32 #else
33 #define MAYBE_TestOnMouseOut TestOnMouseOut
34 #endif
35 TEST_F(MouseLeaveTest, MAYBE_TestOnMouseOut) {
36 GURL test_url = ui_test_utils::GetTestUrl(
37 FilePath(FilePath::kCurrentDirectory),
38 FilePath(FILE_PATH_LITERAL("mouseleave.html")));
39
40 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0);
41 ASSERT_TRUE(browser.get());
42 scoped_refptr<WindowProxy> window = browser->GetWindow();
43 ASSERT_TRUE(window.get());
44 scoped_refptr<TabProxy> tab(GetActiveTab());
45 ASSERT_TRUE(tab.get());
46
47 gfx::Rect tab_view_bounds;
48 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &tab_view_bounds,
49 true));
50 gfx::Point in_content_point(
51 tab_view_bounds.x() + tab_view_bounds.width() / 2,
52 tab_view_bounds.y() + 10);
53 gfx::Point above_content_point(
54 tab_view_bounds.x() + tab_view_bounds.width() / 2,
55 tab_view_bounds.y() - 2);
56
57 // Start by moving the point just above the content.
58 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point));
59
60 // Navigate to the test html page.
61 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(test_url));
62
63 // Wait for the onload() handler to complete so we can do the
64 // next part of the test.
65 ASSERT_TRUE(WaitUntilCookieValue(
66 tab.get(), test_url, "__state",
67 TestTimeouts::large_test_timeout_ms(), "initial"));
68
69 // Move the cursor to the top-center of the content, which will trigger
70 // a javascript onMouseOver event.
71 ASSERT_TRUE(window->SimulateOSMouseMove(in_content_point));
72
73 // Wait on the correct intermediate value of the cookie.
74 ASSERT_TRUE(WaitUntilCookieValue(
75 tab.get(), test_url, "__state",
76 TestTimeouts::large_test_timeout_ms(), "initial,entered"));
77
78 // Move the cursor above the content again, which should trigger
79 // a javascript onMouseOut event.
80 ASSERT_TRUE(window->SimulateOSMouseMove(above_content_point));
81
82 // Wait on the correct final value of the cookie.
83 ASSERT_TRUE(WaitUntilCookieValue(
84 tab.get(), test_url, "__state",
85 TestTimeouts::large_test_timeout_ms(), "initial,entered,left"));
86 }
87
88 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/interactive_ui/keyboard_access_uitest.cc ('k') | chrome/test/interactive_ui/npapi_interactive_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698