| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 using webkit_glue::FormData; | 39 using webkit_glue::FormData; |
| 40 using webkit_glue::FormField; | 40 using webkit_glue::FormField; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 // TODO(isherman): Pull this as a named constant from WebKit | 44 // TODO(isherman): Pull this as a named constant from WebKit |
| 45 const int kDefaultMaxLength = 0x80000; | 45 const int kDefaultMaxLength = 0x80000; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // TODO(jknotten). Fix http://code.google.com/p/chromium/issues/detail?id=70408 | |
| 50 // Test that we get form state change notifications when input fields change. | 49 // Test that we get form state change notifications when input fields change. |
| 51 TEST_F(RenderViewTest, DISABLED_OnNavStateChanged) { | 50 TEST_F(RenderViewTest, OnNavStateChanged) { |
| 52 // Don't want any delay for form state sync changes. This will still post a | 51 // Don't want any delay for form state sync changes. This will still post a |
| 53 // message so updates will get coalesced, but as soon as we spin the message | 52 // message so updates will get coalesced, but as soon as we spin the message |
| 54 // loop, it will generate an update. | 53 // loop, it will generate an update. |
| 55 view_->set_send_content_state_immediately(true); | 54 view_->set_send_content_state_immediately(true); |
| 56 | 55 |
| 57 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); | 56 LoadHTML("<input type=\"text\" id=\"elt_text\"></input>"); |
| 58 | 57 |
| 59 // We should NOT have gotten a form state change notification yet. | 58 // We should NOT have gotten a form state change notification yet. |
| 60 EXPECT_FALSE(render_thread_.sink().GetFirstMessageMatching( | 59 EXPECT_FALSE(render_thread_.sink().GetFirstMessageMatching( |
| 61 ViewHostMsg_UpdateState::ID)); | 60 ViewHostMsg_UpdateState::ID)); |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 LoadHTML("<html><head><meta http-equiv=\"content-language\" " | 1229 LoadHTML("<html><head><meta http-equiv=\"content-language\" " |
| 1231 "content=\" fr , es,en \">" | 1230 "content=\" fr , es,en \">" |
| 1232 "</head><body>A random page with random content.</body></html>"); | 1231 "</head><body>A random page with random content.</body></html>"); |
| 1233 ProcessPendingMessages(); | 1232 ProcessPendingMessages(); |
| 1234 message = render_thread_.sink().GetUniqueMessageMatching( | 1233 message = render_thread_.sink().GetUniqueMessageMatching( |
| 1235 ViewHostMsg_PageContents::ID); | 1234 ViewHostMsg_PageContents::ID); |
| 1236 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 1235 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 1237 ViewHostMsg_PageContents::Read(message, ¶ms); | 1236 ViewHostMsg_PageContents::Read(message, ¶ms); |
| 1238 EXPECT_EQ("fr", params.d); | 1237 EXPECT_EQ("fr", params.d); |
| 1239 } | 1238 } |
| OLD | NEW |