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

Side by Side Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 2455663004: Add test to ensure that URLs that redirect inside the PDF plugin fail to load (Closed)
Patch Set: Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 903
904 ASSERT_EQ(2U, chrome::GetTotalBrowserCount()); 904 ASSERT_EQ(2U, chrome::GetTotalBrowserCount());
905 905
906 content::WebContents* active_web_contents = 906 content::WebContents* active_web_contents =
907 chrome::FindLastActive()->tab_strip_model()->GetActiveWebContents(); 907 chrome::FindLastActive()->tab_strip_model()->GetActiveWebContents();
908 ASSERT_NE(web_contents, active_web_contents); 908 ASSERT_NE(web_contents, active_web_contents);
909 909
910 const GURL& url = active_web_contents->GetURL(); 910 const GURL& url = active_web_contents->GetURL();
911 ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); 911 ASSERT_EQ(std::string("http://www.example.com/"), url.spec());
912 } 912 }
913
914 // Test that if the plugin tries to load a URL that redirects that it will fail
Lei Zhang 2016/11/08 01:28:10 ... _then_ it will fail?
raymes 2016/11/08 06:00:01 Done.
915 // to load. This is to avoid the source origin of the document changing during
916 // the redirect, which can have security implications. crbug.com/653749
Lei Zhang 2016/11/08 01:28:10 If you add https:// in the URL, then cs.chromium.o
raymes 2016/11/08 06:00:01 Done.
917 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, RedirectsFailInPlugin) {
918 RunTestsInFile("redirects_fail_test.js", "test.pdf");
919 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/pdf/redirects_fail_test.js » ('j') | pdf/out_of_process_instance.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698