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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 const std::string exceeded_data_url(1024 * 1024 * 10 + 1, 'd'); | 445 const std::string exceeded_data_url(1024 * 1024 * 10 + 1, 'd'); |
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, DISABLED_OnNavStateChanged) { | 455 TEST_F(RenderViewImplTest, OnNavStateChanged) { |
Charlie Reis
2015/11/25 20:22:12
I'm thinking I'll re-enable the test first in http
| |
456 // 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 |
457 // 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 |
458 // loop, it will generate an update. | 458 // loop, it will generate an update. |
459 view()->set_send_content_state_immediately(true); | 459 view()->set_send_content_state_immediately(true); |
460 | 460 |
461 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); | 461 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); |
462 | 462 |
463 // We should NOT have gotten a form state change notification yet. | 463 // We should NOT have gotten a form state change notification yet. |
464 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( | 464 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
465 FrameHostMsg_UpdateState::ID)); | |
466 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( | |
465 ViewHostMsg_UpdateState::ID)); | 467 ViewHostMsg_UpdateState::ID)); |
466 render_thread_->sink().ClearMessages(); | 468 render_thread_->sink().ClearMessages(); |
467 | 469 |
468 // 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 |
469 // 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. |
470 ExecuteJavaScriptForTests( | 472 ExecuteJavaScriptForTests( |
471 "document.getElementById('elt_text').value = 'foo';"); | 473 "document.getElementById('elt_text').value = 'foo';"); |
472 ProcessPendingMessages(); | 474 ProcessPendingMessages(); |
473 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( | 475 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
474 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 } | |
475 } | 482 } |
476 | 483 |
477 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { | 484 TEST_F(RenderViewImplTest, OnNavigationHttpPost) { |
478 // 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. |
479 CommonNavigationParams common_params; | 486 CommonNavigationParams common_params; |
480 StartNavigationParams start_params; | 487 StartNavigationParams start_params; |
481 RequestNavigationParams request_params; | 488 RequestNavigationParams request_params; |
482 common_params.url = GURL("data:text/html,<div>Page</div>"); | 489 common_params.url = GURL("data:text/html,<div>Page</div>"); |
483 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 490 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
484 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... | |
2475 FROM_HERE, | 2482 FROM_HERE, |
2476 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2483 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2477 ExecuteJavaScriptForTests("debugger;"); | 2484 ExecuteJavaScriptForTests("debugger;"); |
2478 | 2485 |
2479 // CloseWhilePaused should resume execution and continue here. | 2486 // CloseWhilePaused should resume execution and continue here. |
2480 EXPECT_FALSE(IsPaused()); | 2487 EXPECT_FALSE(IsPaused()); |
2481 Detach(); | 2488 Detach(); |
2482 } | 2489 } |
2483 | 2490 |
2484 } // namespace content | 2491 } // namespace content |
OLD | NEW |