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

Side by Side Diff: content/browser/download/mhtml_generation_browsertest.cc

Issue 2656713002: Merge to M57: Remove popup overlay from MHTML when requested (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 5 #include <stdint.h>
6 #include <memory> 6 #include <memory>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 EXPECT_THAT(mhtml, HasSubstr("This page has no title")); // From title1.html. 642 EXPECT_THAT(mhtml, HasSubstr("This page has no title")); // From title1.html.
643 643
644 // Make sure that URLs of both frames are present 644 // Make sure that URLs of both frames are present
645 // (note that these are single-line regexes). 645 // (note that these are single-line regexes).
646 EXPECT_THAT( 646 EXPECT_THAT(
647 mhtml, 647 mhtml,
648 ContainsRegex("Content-Location:.*/frame_tree/page_with_one_frame.html")); 648 ContainsRegex("Content-Location:.*/frame_tree/page_with_one_frame.html"));
649 EXPECT_THAT(mhtml, ContainsRegex("Content-Location:.*/title1.html")); 649 EXPECT_THAT(mhtml, ContainsRegex("Content-Location:.*/title1.html"));
650 } 650 }
651 651
652 IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, RemovePopupOverlay) {
653 base::FilePath path(temp_dir_.GetPath());
654 path = path.Append(FILE_PATH_LITERAL("test.mht"));
655
656 GURL url(embedded_test_server()->GetURL("/popup.html"));
657
658 MHTMLGenerationParams params(path);
659 params.remove_popup_overlay = true;
660
661 GenerateMHTML(params, url);
662 ASSERT_FALSE(HasFailure());
663
664 std::string mhtml;
665 {
666 base::ThreadRestrictions::ScopedAllowIO allow_io_for_content_verification;
667 ASSERT_TRUE(base::ReadFileToString(path, &mhtml));
668 }
669
670 // Make sure the overlay is removed.
671 EXPECT_THAT(mhtml, Not(HasSubstr("class=3D\"overlay")));
672 EXPECT_THAT(mhtml, Not(HasSubstr("class=3D\"modal")));
673 }
674
652 } // namespace content 675 } // namespace content
OLDNEW
« no previous file with comments | « components/offline_pages/core/offline_page_test_archiver.cc ('k') | content/browser/download/mhtml_generation_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698