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

Issue 1412733017: Tests comparing original-vs-saved multi-frame pages. (Closed)

Created:
5 years, 1 month ago by Łukasz Anforowicz
Modified:
5 years, 1 month ago
Reviewers:
asanka
CC:
chromium-reviews, darin-cc_chromium.org, jam, Randy Smith (Not in Mondays), site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Tests comparing original-vs-saved for multi-frame pages. Extra tests navigate to the saved file and verify if it "looks" the same as the original page (i.e. if it has the same number of frames, if it has the expected substrings from all subframes, if it has no "err" substrings). The extra verification done by the new test catches some regressions that older tests would not catch (i.e. without the new tests verifying about:blank regressions is tricky, as substrings for subframes can appear in the saved file but end up not being rendered because of incorrect cross-referencing). Additionally the extra verification adds coverage for newly discovered bugs (i.e. for handling of <object> elements). More details about the changes: - The new resources got created manually from scratch: pdf.pdf and svg.svg using Inkscape, png.png using Gimp. - iframes.htm got renamed to frames-xsite.htm (to be named consistently with the other 2 test files in this CL). - local-about-blank-subframes.htm got renamed to frames-about-blank.htm and moved from content/test/data/download into chrome/test/data/save_page/ The test using this file in mhtml_generation_browsertest.cc got removed - the coverage offered by one of the new tests (SavePageMultiFrameBrowserTest.AboutBlank_MHTML) is a superset of the coverage from the old test. - Content verification markers got tweaked so the tests are easier to read (i.e. it is more apparent which htm test file the given guid comes from). - The SavePageMultiFrameBrowserTest to some extent overlap coverage of existing SavePageSitePerProcessBrowserTest. This is ok, as the old and new tests still verify some things unique to a specific test. - In theory we could reuse SavePageSitePerProcessBrowserTest class. I've put the new tests into a separate SavePageMultiFrameBrowserTest class, because all new tests perform the same steps and verification and I plan to parametrize SavePageMultiFrameBrowserTest in the future by having it inherit from ::testing::WithParamInterface<SavePageType>. BUG=553478, 539936, 538766, 526786 Committed: https://crrev.com/4771dd55cdc2ca26c955776056d540ec62da40e6 Cr-Commit-Position: refs/heads/master@{#359351}

Patch Set 1 #

Patch Set 2 : Fixing base::FilePath -> std::string conversion. #

Total comments: 14

Patch Set 3 : Addressed feedback from Asanka. #

Patch Set 4 : Using the right test file extension for html-only save-type. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -134 lines) Patch
M chrome/browser/download/save_page_browsertest.cc View 1 2 3 8 chunks +216 lines, -31 lines 0 comments Download
M chrome/test/data/save_page/a.htm View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/test/data/save_page/b.htm View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/save_page/b.saved1.htm View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/save_page/b.saved2.htm View 1 chunk +2 lines, -1 line 0 comments Download
A + chrome/test/data/save_page/frames-about-blank.htm View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/save_page/frames-objects.htm View 1 chunk +41 lines, -0 lines 0 comments Download
A + chrome/test/data/save_page/frames-xsite.htm View 1 chunk +2 lines, -1 line 0 comments Download
D chrome/test/data/save_page/iframes.htm View 1 chunk +0 lines, -26 lines 0 comments Download
A chrome/test/data/save_page/pdf.pdf View Binary file 0 comments Download
A chrome/test/data/save_page/png.png View Binary file 0 comments Download
A chrome/test/data/save_page/svg.svg View 1 chunk +81 lines, -0 lines 0 comments Download
M content/browser/download/mhtml_generation_browsertest.cc View 1 chunk +0 lines, -34 lines 0 comments Download
D content/test/data/download/local-about-blank-subframes.html View 1 chunk +0 lines, -39 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (2 generated)
Łukasz Anforowicz
Asanka, could you please take a look?
5 years, 1 month ago (2015-11-11 19:59:11 UTC) #2
asanka
What's the entropy like for MHTML? Can we generate a reference file and have the ...
5 years, 1 month ago (2015-11-11 21:37:37 UTC) #3
Łukasz Anforowicz
Asanka, could you please take another look? https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc File chrome/browser/download/save_page_browsertest.cc (right): https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc#newcode310 chrome/browser/download/save_page_browsertest.cc:310: void GetDestinationPaths(const ...
5 years, 1 month ago (2015-11-11 23:55:40 UTC) #4
asanka
https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc File chrome/browser/download/save_page_browsertest.cc (right): https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc#newcode310 chrome/browser/download/save_page_browsertest.cc:310: void GetDestinationPaths(const std::string& prefix, On 2015/11/11 at 23:55:40, Łukasz ...
5 years, 1 month ago (2015-11-12 03:14:37 UTC) #5
Łukasz Anforowicz
Asanka, could you please take another look? https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc File chrome/browser/download/save_page_browsertest.cc (right): https://codereview.chromium.org/1412733017/diff/20001/chrome/browser/download/save_page_browsertest.cc#newcode310 chrome/browser/download/save_page_browsertest.cc:310: void GetDestinationPaths(const ...
5 years, 1 month ago (2015-11-12 06:30:27 UTC) #6
asanka
lgtm What's the story with Document.open() on an iframe? I recall from somewhere that that ...
5 years, 1 month ago (2015-11-12 16:03:03 UTC) #7
Łukasz Anforowicz
On 2015/11/12 16:03:03, asanka wrote: > lgtm > Thanks for reviewing. > What's the story ...
5 years, 1 month ago (2015-11-12 17:13:28 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1412733017/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1412733017/60001
5 years, 1 month ago (2015-11-12 17:14:44 UTC) #10
asanka
On 2015/11/12 at 17:13:28, lukasza wrote: > On 2015/11/12 16:03:03, asanka wrote: > > lgtm ...
5 years, 1 month ago (2015-11-12 17:24:18 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 1 month ago (2015-11-12 19:00:32 UTC) #12
commit-bot: I haz the power
5 years, 1 month ago (2015-11-12 20:08:44 UTC) #13
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/4771dd55cdc2ca26c955776056d540ec62da40e6
Cr-Commit-Position: refs/heads/master@{#359351}

Powered by Google App Engine
This is Rietveld 408576698