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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 view()->saveImageFromDataURL(WebString::fromUTF8(exceeded_data_url)); | 447 view()->saveImageFromDataURL(WebString::fromUTF8(exceeded_data_url)); |
448 ProcessPendingMessages(); | 448 ProcessPendingMessages(); |
449 const IPC::Message* msg4 = render_thread_->sink().GetFirstMessageMatching( | 449 const IPC::Message* msg4 = render_thread_->sink().GetFirstMessageMatching( |
450 ViewHostMsg_SaveImageFromDataURL::ID); | 450 ViewHostMsg_SaveImageFromDataURL::ID); |
451 EXPECT_FALSE(msg4); | 451 EXPECT_FALSE(msg4); |
452 } | 452 } |
453 | 453 |
454 // Test that we get form state change notifications when input fields change. | 454 // Test that we get form state change notifications when input fields change. |
455 TEST_F(RenderViewImplTest, OnNavStateChanged) { | 455 TEST_F(RenderViewImplTest, OnNavStateChanged) { |
456 // TODO(creis): Make the UpdateState timer work in OOPIF modes. | |
457 // See https://crbug.com/545219. | |
458 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) | |
459 return; | |
460 | |
461 // Don't want any delay for form state sync changes. This will still post a | 456 // Don't want any delay for form state sync changes. This will still post a |
462 // message so updates will get coalesced, but as soon as we spin the message | 457 // message so updates will get coalesced, but as soon as we spin the message |
463 // loop, it will generate an update. | 458 // loop, it will generate an update. |
464 view()->set_send_content_state_immediately(true); | 459 view()->set_send_content_state_immediately(true); |
465 | 460 |
466 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); | 461 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); |
467 | 462 |
468 // We should NOT have gotten a form state change notification yet. | 463 // We should NOT have gotten a form state change notification yet. |
469 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( | 464 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
| 465 FrameHostMsg_UpdateState::ID)); |
| 466 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
470 ViewHostMsg_UpdateState::ID)); | 467 ViewHostMsg_UpdateState::ID)); |
471 render_thread_->sink().ClearMessages(); | 468 render_thread_->sink().ClearMessages(); |
472 | 469 |
473 // Change the value of the input. We should have gotten an update state | 470 // Change the value of the input. We should have gotten an update state |
474 // notification. We need to spin the message loop to catch this update. | 471 // notification. We need to spin the message loop to catch this update. |
475 ExecuteJavaScriptForTests( | 472 ExecuteJavaScriptForTests( |
476 "document.getElementById('elt_text').value = 'foo';"); | 473 "document.getElementById('elt_text').value = 'foo';"); |
477 ProcessPendingMessages(); | 474 ProcessPendingMessages(); |
478 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( | 475 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
479 ViewHostMsg_UpdateState::ID)); | 476 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( |
| 477 FrameHostMsg_UpdateState::ID)); |
| 478 } else { |
| 479 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( |
| 480 ViewHostMsg_UpdateState::ID)); |
| 481 } |
480 } | 482 } |
481 | 483 |
482 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { | 484 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { |
483 // An http url will trigger a resource load so cannot be used here. | 485 // An http url will trigger a resource load so cannot be used here. |
484 CommonNavigationParams common_params; | 486 CommonNavigationParams common_params; |
485 StartNavigationParams start_params; | 487 StartNavigationParams start_params; |
486 RequestNavigationParams request_params; | 488 RequestNavigationParams request_params; |
487 common_params.url = GURL("data:text/html,<div>Page</div>"); | 489 common_params.url = GURL("data:text/html,<div>Page</div>"); |
488 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 490 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
489 common_params.transition = ui::PAGE_TRANSITION_TYPED; | 491 common_params.transition = ui::PAGE_TRANSITION_TYPED; |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2480 FROM_HERE, | 2482 FROM_HERE, |
2481 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2483 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2482 ExecuteJavaScriptForTests("debugger;"); | 2484 ExecuteJavaScriptForTests("debugger;"); |
2483 | 2485 |
2484 // CloseWhilePaused should resume execution and continue here. | 2486 // CloseWhilePaused should resume execution and continue here. |
2485 EXPECT_FALSE(IsPaused()); | 2487 EXPECT_FALSE(IsPaused()); |
2486 Detach(); | 2488 Detach(); |
2487 } | 2489 } |
2488 | 2490 |
2489 } // namespace content | 2491 } // namespace content |
OLD | NEW |