Commit 33b9b026 authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Change TemporaryAddressSpoof test to not depend on PDF OpenActions.

OpenActions that navigate to URIs are going to be blocked when
https://pdfium-review.googlesource.com/c/pdfium/+/42731 relands.
It was reverted because this test was breaking and blocking the
pdfium roll into chromium.

The test will now click on a link in the PDF that navigates to the
URI.

Bug: 851821
Change-Id: I49853e99de7b989858b1962ad4a92a4168d4c2db
Reviewed-on: https://chromium-review.googlesource.com/c/1244367
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596011}
parent e2191298
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/window_controller.h" #include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/pdf/pdf_extension_test_util.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h"
...@@ -2074,6 +2075,18 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_TemporaryAddressSpoof) { ...@@ -2074,6 +2075,18 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_TemporaryAddressSpoof) {
ui_test_utils::NavigateToURLWithDisposition( ui_test_utils::NavigateToURLWithDisposition(
browser(), url, WindowOpenDisposition::CURRENT_TAB, browser(), url, WindowOpenDisposition::CURRENT_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
bool load_success =
pdf_extension_test_util::EnsurePDFHasLoaded(second_web_contents);
EXPECT_TRUE(load_success);
// The actual PDF page coordinates that this click goes to is (346, 333),
// after several space transformations, not (400, 400). This clicks on a link
// to "http://www.facebook.com:83".
content::SimulateMouseClickAt(second_web_contents, 0,
blink::WebMouseEvent::Button::kLeft,
gfx::Point(400, 400));
EXPECT_TRUE(navigation_manager.WaitForRequestStart()); EXPECT_TRUE(navigation_manager.WaitForRequestStart());
browser()->tab_strip_model()->ActivateTabAt(0, true); browser()->tab_strip_model()->ActivateTabAt(0, true);
......
...@@ -4,8 +4,7 @@ onbeforeunload=function(){ ...@@ -4,8 +4,7 @@ onbeforeunload=function(){
document.title='OtherWebsite.ltd'; document.title='OtherWebsite.ltd';
}; };
</script> </script>
<embed type="application/pdf" src="data:application/pdf;base64,JVBERi0xLjcKIAp0cmFpbGVyCjw8Ci9Sb290IDEgMCBSCj4+CiAKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKL09wZW5BY3Rpb24gMiAwIFIKPj4KZW5kb2JqCiAKMiAwIG9iago8PAovVHlwZSAvQWN0aW9uCi9TIC9VUkkKL1VSSSAoaHR0cDovL3d3dy5mYWNlYm9vay5jb206ODMpCj4+CmVuZG9iagogCiUlRU9G" width="640" height="480"> <embed type="application/pdf" src="data:application/pdf;base64,JVBERi0xLjcKIAp0cmFpbGVyCjw8Ci9Sb290IDEgMCBSCj4+CiAKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCgoyIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovQ291bnQgMQovS2lkcyBbMyAwIFJdCj4+CmVuZG9iagoKMyAwIG9iago8PAovVHlwZSAvUGFnZQovUGFyZW50IDIgMCBSCi9NZWRpYUJveCBbMCAwIDQwMCA0MDBdCi9SZXNvdXJjZXMgPDw+PgovQW5ub3RzIFs0IDAgUl0KPj4KZW5kb2JqCgo0IDAgb2JqCjw8Ci9UeXBlIC9Bbm5vdAovU3VidHlwZSAvTGluawovUmVjdCBbMCAwIDQwMCA0MDBdCi9BIDUgMCBSCj4+CmVuZG9iagoKNSAwIG9iago8PAovVHlwZSAvQWN0aW9uCi9TIC9VUkkKL1VSSSAoaHR0cDovL3d3dy5mYWNlYm9vay5jb206ODMpCj4+CmVuZG9iagoKJSVFT0Y=" width="640" height="480">
<!-- <!--
...@@ -23,12 +22,38 @@ trailer ...@@ -23,12 +22,38 @@ trailer
<< <<
/Type /Catalog /Type /Catalog
/Pages 2 0 R /Pages 2 0 R
/OpenAction 2 0 R
>> >>
endobj endobj
2 0 obj 2 0 obj
<< <<
/Type /Pages
/Count 1
/Kids [3 0 R]
>>
endobj
3 0 obj
<<
/Type /Page
/Parent 2 0 R
/MediaBox [0 0 400 400]
/Resources <<>>
/Annots [4 0 R]
>>
endobj
4 0 obj
<<
/Type /Annot
/Subtype /Link
/Rect [0 0 400 400]
/A 5 0 R
>>
endobj
5 0 obj
<<
/Type /Action /Type /Action
/S /URI /S /URI
/URI (http://www.facebook.com:83) /URI (http://www.facebook.com:83)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment