Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor LinkAnnotation slightly, improve handling of the GoToR action, and add unit-tests #7116

Merged
merged 3 commits into from
Apr 16, 2016
Merged

Refactor LinkAnnotation slightly, improve handling of the GoToR action, and add unit-tests #7116

merged 3 commits into from
Apr 16, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 26, 2016

Please refer to the individual commit messages for additional information.

This PR contains the majority of PR #7058, plus more unit-tests, since that should be useful even if we decide not to add support for relative URLs.

Note: Ignoring whitespace should simplify reviewing of the first patch, see Snuffleupagus@b63ef7a?w=1.

Edit: I'm assuming that we want to land PR #7126 before this one, since this PR should be much easier to rebase given its smaller smaller scope. That PR was merged, and this PR has been updated accordingly.

@Snuffleupagus
Copy link
Collaborator Author

These unit-test failures look really weird, and I can't understand how/why they happen!
It passes just fine locally, and the failures seem to come from a test in network_spec.js, a file which this PR doesn't even touch!?

@Snuffleupagus
Copy link
Collaborator Author

Interestingly, it seems that the unit-tests now fail in the same way on master as well, see #3891 (comment) and below.

@Snuffleupagus
Copy link
Collaborator Author

Interestingly, the last test run (based on Snuffleupagus@acbd625) seems to suggest that the file pdf.pdf has somehow gone missing from the /test/pdfs/ directory on both of the bots.

@Snuffleupagus
Copy link
Collaborator Author

Oh, I think I know what's going on here!
Since the unit-tests pass on the bots when run as part of the test command, but not when invoked with unittest, this is probably the same issue as in #6209 (comment).

@@ -160,14 +160,20 @@ PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet;
* @param {HTMLLinkElement} link - The link element.
* @param {Object} params - An object with the properties:
* @param {string} params.url - An absolute URL.
* @param {boolean} params.newWindow - (optional) The 'NewWindow' property of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #7126, there is a refactoring to add the 'target' attribute to params.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as I mentioned above that PR should land first. After that, I've already planned on changing this code to use the target parameter instead :-)

@timvandermeij
Copy link
Contributor

This PR needs a rebase (and update) after the recently landed patches.

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Apr 7, 2016

This PR needs a rebase (and update) after the recently landed patches.

Thanks for the reminder, fixed now!

…he end

This patch also makes sure that all URLs are converted to the correct encoding.
 - Add support for the 'NewWindow' property.

 - Ensure that destinations are applied to the *remote* document, instead of the current one.

 - Handle the `F` entry being a standard string, instead of a dictionary.
We currently don't have *any* unit-tests for `LinkAnnotation`s, so it seemed a good idea to add a few. These tests are taken from various actual PDF files.
@Snuffleupagus
Copy link
Collaborator Author

@timvandermeij Would you be willing to reviewing this PR?

@timvandermeij timvandermeij self-assigned this Apr 16, 2016
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/87f2e233691d9ec/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/275d2e607a72c8c/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/ac3612f3da193d5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/275d2e607a72c8c/output.txt

Total script time: 20.53 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/ac3612f3da193d5/output.txt

Total script time: 22.50 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit 452c031 into mozilla:master Apr 16, 2016
@timvandermeij
Copy link
Contributor

Nice work, thanks!

@Snuffleupagus Snuffleupagus deleted the refactor-LinkAnnotation-tests branch April 16, 2016 13:53
@Snuffleupagus
Copy link
Collaborator Author

@timvandermeij Thank you so much for reviewing and merging this!
Now I can finish the new, and improved, version of PR #7058 (WIP at master...Snuffleupagus:bug-766086).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants