| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Watch for all possible outcomes to avoid timeouts if something breaks. | 174 // Watch for all possible outcomes to avoid timeouts if something breaks. |
| 175 AddAllPossibleTitles(start_url, &title_watcher); | 175 AddAllPossibleTitles(start_url, &title_watcher); |
| 176 | 176 |
| 177 ui_test_utils::NavigateToURL(browser(), start_url); | 177 ui_test_utils::NavigateToURL(browser(), start_url); |
| 178 | 178 |
| 179 if (button != blink::WebMouseEvent::Button::NoButton) { | 179 if (button != blink::WebMouseEvent::Button::NoButton) { |
| 180 blink::WebMouseEvent mouse_event( | 180 blink::WebMouseEvent mouse_event( |
| 181 blink::WebInputEvent::MouseDown, blink::WebInputEvent::NoModifiers, | 181 blink::WebInputEvent::MouseDown, blink::WebInputEvent::NoModifiers, |
| 182 blink::WebInputEvent::TimeStampForTesting); | 182 blink::WebInputEvent::TimeStampForTesting); |
| 183 mouse_event.button = button; | 183 mouse_event.button = button; |
| 184 mouse_event.x = 15; | 184 mouse_event.setPositionInWidget(15, 15); |
| 185 mouse_event.y = 15; | |
| 186 mouse_event.clickCount = 1; | 185 mouse_event.clickCount = 1; |
| 187 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); | 186 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); |
| 188 mouse_event.setType(blink::WebInputEvent::MouseUp); | 187 mouse_event.setType(blink::WebInputEvent::MouseUp); |
| 189 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); | 188 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); |
| 190 } | 189 } |
| 191 | 190 |
| 192 if (disposition == WindowOpenDisposition::CURRENT_TAB) { | 191 if (disposition == WindowOpenDisposition::CURRENT_TAB) { |
| 193 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 192 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 194 } else { | 193 } else { |
| 195 tab_added_observer.Wait(); | 194 tab_added_observer.Wait(); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 HttpLeftClickRedirectDefaultFlag) { | 613 HttpLeftClickRedirectDefaultFlag) { |
| 615 blink::WebReferrerPolicy expected_referrer_policy = | 614 blink::WebReferrerPolicy expected_referrer_policy = |
| 616 blink::WebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin; | 615 blink::WebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin; |
| 617 | 616 |
| 618 RunReferrerTest(blink::WebReferrerPolicyDefault, START_ON_HTTP, REGULAR_LINK, | 617 RunReferrerTest(blink::WebReferrerPolicyDefault, START_ON_HTTP, REGULAR_LINK, |
| 619 SERVER_REDIRECT_FROM_HTTP_TO_HTTPS, | 618 SERVER_REDIRECT_FROM_HTTP_TO_HTTPS, |
| 620 WindowOpenDisposition::CURRENT_TAB, | 619 WindowOpenDisposition::CURRENT_TAB, |
| 621 blink::WebMouseEvent::Button::Left, EXPECT_ORIGIN_AS_REFERRER, | 620 blink::WebMouseEvent::Button::Left, EXPECT_ORIGIN_AS_REFERRER, |
| 622 expected_referrer_policy); | 621 expected_referrer_policy); |
| 623 } | 622 } |
| OLD | NEW |