| OLD | NEW |
| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 return test_guest_view_manager_; | 315 return test_guest_view_manager_; |
| 316 } | 316 } |
| 317 | 317 |
| 318 private: | 318 private: |
| 319 guest_view::TestGuestViewManagerFactory factory_; | 319 guest_view::TestGuestViewManagerFactory factory_; |
| 320 guest_view::TestGuestViewManager* test_guest_view_manager_; | 320 guest_view::TestGuestViewManager* test_guest_view_manager_; |
| 321 | 321 |
| 322 DISALLOW_COPY_AND_ASSIGN(ChromeSitePerProcessPDFTest); | 322 DISALLOW_COPY_AND_ASSIGN(ChromeSitePerProcessPDFTest); |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 // TODO(ekaramad): This test is flaky on Windows 7. Enable it when the issue is | |
| 326 // fixed ((https://crbug.com/666379). | |
| 327 #if defined(OS_WIN) | |
| 328 #define MAYBE_EmbeddedPDFInsideCrossOriginFrame \ | |
| 329 DISABLED_EmbeddedPDFInsideCrossOriginFrame | |
| 330 #else | |
| 331 #define MAYBE_EmbeddedPDFInsideCrossOriginFrame \ | |
| 332 EmbeddedPDFInsideCrossOriginFrame | |
| 333 #endif | |
| 334 // This test verifies that when navigating an OOPIF to a page with <embed>-ed | 325 // This test verifies that when navigating an OOPIF to a page with <embed>-ed |
| 335 // PDF, the guest is properly created, and by removing the embedder frame, the | 326 // PDF, the guest is properly created, and by removing the embedder frame, the |
| 336 // guest is properly destroyed (https://crbug.com/649856). | 327 // guest is properly destroyed (https://crbug.com/649856). |
| 337 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessPDFTest, | 328 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessPDFTest, |
| 338 MAYBE_EmbeddedPDFInsideCrossOriginFrame) { | 329 EmbeddedPDFInsideCrossOriginFrame) { |
| 339 // Navigate to a page with an <iframe>. | 330 // Navigate to a page with an <iframe>. |
| 340 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); | 331 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); |
| 341 ui_test_utils::NavigateToURL(browser(), main_url); | 332 ui_test_utils::NavigateToURL(browser(), main_url); |
| 342 | 333 |
| 343 // Initially, no guests are created. | 334 // Initially, no guests are created. |
| 344 EXPECT_EQ(0U, test_guest_view_manager()->num_guests_created()); | 335 EXPECT_EQ(0U, test_guest_view_manager()->num_guests_created()); |
| 345 | 336 |
| 346 // Navigate subframe to a cross-site page with an embedded PDF. | 337 // Navigate subframe to a cross-site page with an embedded PDF. |
| 347 content::WebContents* active_web_contents = | 338 content::WebContents* active_web_contents = |
| 348 browser()->tab_strip_model()->GetActiveWebContents(); | 339 browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 "document.querySelector('iframe').src = '" + frame_url.spec() + "';\n" | 493 "document.querySelector('iframe').src = '" + frame_url.spec() + "';\n" |
| 503 "var w = window.open('about:blank');\n" | 494 "var w = window.open('about:blank');\n" |
| 504 "window.domAutomationController.send(!!w);\n", | 495 "window.domAutomationController.send(!!w);\n", |
| 505 &popup_handle_is_valid)); | 496 &popup_handle_is_valid)); |
| 506 popup_observer.Wait(); | 497 popup_observer.Wait(); |
| 507 | 498 |
| 508 // The popup shouldn't be blocked. | 499 // The popup shouldn't be blocked. |
| 509 EXPECT_TRUE(popup_handle_is_valid); | 500 EXPECT_TRUE(popup_handle_is_valid); |
| 510 ASSERT_EQ(2, browser()->tab_strip_model()->count()); | 501 ASSERT_EQ(2, browser()->tab_strip_model()->count()); |
| 511 } | 502 } |
| OLD | NEW |