OLD | NEW |
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 <list> | 5 #include <list> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (validated_url != delay_url_ || !rvh_) | 185 if (validated_url != delay_url_ || !rvh_) |
186 return; | 186 return; |
187 | 187 |
188 rvh_->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(script_)); | 188 rvh_->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(script_)); |
189 script_was_executed_ = true; | 189 script_was_executed_ = true; |
190 } | 190 } |
191 | 191 |
192 virtual void DidCommitProvisionalLoadForFrame( | 192 virtual void DidCommitProvisionalLoadForFrame( |
193 content::RenderFrameHost* render_frame_host, | 193 content::RenderFrameHost* render_frame_host, |
194 const GURL& url, | 194 const GURL& url, |
195 content::PageTransition transition_type) OVERRIDE { | 195 ui::PageTransition transition_type) OVERRIDE { |
196 if (script_was_executed_ && EndsWith(url.spec(), until_url_suffix_, true)) { | 196 if (script_was_executed_ && EndsWith(url.spec(), until_url_suffix_, true)) { |
197 content::WebContentsObserver::Observe(NULL); | 197 content::WebContentsObserver::Observe(NULL); |
198 test_navigation_listener_->ResumeAll(); | 198 test_navigation_listener_->ResumeAll(); |
199 } | 199 } |
200 rvh_ = render_frame_host->GetRenderViewHost(); | 200 rvh_ = render_frame_host->GetRenderViewHost(); |
201 } | 201 } |
202 | 202 |
203 private: | 203 private: |
204 content::NotificationRegistrar registrar_; | 204 content::NotificationRegistrar registrar_; |
205 | 205 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 ASSERT_TRUE(RunExtensionTest("webnavigation/targetBlank")) << message_; | 477 ASSERT_TRUE(RunExtensionTest("webnavigation/targetBlank")) << message_; |
478 | 478 |
479 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 479 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
480 content::WaitForLoadStop(tab); | 480 content::WaitForLoadStop(tab); |
481 | 481 |
482 ResultCatcher catcher; | 482 ResultCatcher catcher; |
483 | 483 |
484 GURL url = embedded_test_server()->GetURL( | 484 GURL url = embedded_test_server()->GetURL( |
485 "/extensions/api_test/webnavigation/targetBlank/a.html"); | 485 "/extensions/api_test/webnavigation/targetBlank/a.html"); |
486 | 486 |
487 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); | 487 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK); |
488 ui_test_utils::NavigateToURL(¶ms); | 488 ui_test_utils::NavigateToURL(¶ms); |
489 | 489 |
490 // There's a link with target=_blank on a.html. Click on it to open it in a | 490 // There's a link with target=_blank on a.html. Click on it to open it in a |
491 // new tab. | 491 // new tab. |
492 blink::WebMouseEvent mouse_event; | 492 blink::WebMouseEvent mouse_event; |
493 mouse_event.type = blink::WebInputEvent::MouseDown; | 493 mouse_event.type = blink::WebInputEvent::MouseDown; |
494 mouse_event.button = blink::WebMouseEvent::ButtonLeft; | 494 mouse_event.button = blink::WebMouseEvent::ButtonLeft; |
495 mouse_event.x = 7; | 495 mouse_event.x = 7; |
496 mouse_event.y = 7; | 496 mouse_event.y = 7; |
497 mouse_event.clickCount = 1; | 497 mouse_event.clickCount = 1; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 "extensions/api_test/webnavigation/crash/b.html", | 628 "extensions/api_test/webnavigation/crash/b.html", |
629 embedded_test_server()->port())); | 629 embedded_test_server()->port())); |
630 ui_test_utils::NavigateToURL(browser(), url); | 630 ui_test_utils::NavigateToURL(browser(), url); |
631 | 631 |
632 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 632 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
633 } | 633 } |
634 | 634 |
635 #endif | 635 #endif |
636 | 636 |
637 } // namespace extensions | 637 } // namespace extensions |
OLD | NEW |