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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "chrome/browser/automation/automation_provider_observers.h" | 9 #include "chrome/browser/automation/automation_provider_observers.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 11 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/common/automation_constants.h" | 12 #include "chrome/common/automation_constants.h" |
13 #include "chrome/common/automation_events.h" | 13 #include "chrome/common/automation_events.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
21 #include "ui/gfx/point.h" | 21 #include "ui/gfx/point.h" |
22 | 22 |
23 class AutomationMiscBrowserTest : public InProcessBrowserTest { | 23 class AutomationMiscBrowserTest : public InProcessBrowserTest { |
24 public: | 24 public: |
25 AutomationMiscBrowserTest() { | 25 AutomationMiscBrowserTest() {} |
26 EnableDOMAutomation(); | |
27 } | |
28 | 26 |
29 virtual ~AutomationMiscBrowserTest() { } | 27 virtual ~AutomationMiscBrowserTest() {} |
30 }; | 28 }; |
31 | 29 |
32 class MockMouseEventCallback { | 30 class MockMouseEventCallback { |
33 public: | 31 public: |
34 typedef AutomationMouseEventProcessor::CompletionCallback CompletionCallback; | 32 typedef AutomationMouseEventProcessor::CompletionCallback CompletionCallback; |
35 typedef AutomationMouseEventProcessor::ErrorCallback ErrorCallback; | 33 typedef AutomationMouseEventProcessor::ErrorCallback ErrorCallback; |
36 | 34 |
37 MockMouseEventCallback() { | 35 MockMouseEventCallback() { |
38 completion_callback_ = base::Bind( | 36 completion_callback_ = base::Bind( |
39 &MockMouseEventCallback::OnSuccess, | 37 &MockMouseEventCallback::OnSuccess, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 mock.error_callback()); | 97 mock.error_callback()); |
100 | 98 |
101 bool did_click = false; | 99 bool did_click = false; |
102 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 100 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
103 view, | 101 view, |
104 L"", | 102 L"", |
105 L"window.domAutomationController.send(window.didClick);", | 103 L"window.domAutomationController.send(window.didClick);", |
106 &did_click)); | 104 &did_click)); |
107 EXPECT_TRUE(did_click); | 105 EXPECT_TRUE(did_click); |
108 } | 106 } |
OLD | NEW |