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 "chrome/common/render_messages.h" | 5 #include "chrome/common/render_messages.h" |
6 #include "chrome/test/render_view_test.h" | 6 #include "chrome/test/render_view_test.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
11 #include "webkit/glue/form_data.h" | 11 #include "webkit/glue/form_data.h" |
12 | 12 |
13 using webkit_glue::FormData; | 13 using webkit_glue::FormData; |
14 using WebKit::WebCompositionCommand; | |
15 using WebKit::WebFrame; | 14 using WebKit::WebFrame; |
16 using WebKit::WebString; | 15 using WebKit::WebString; |
17 using WebKit::WebTextDirection; | 16 using WebKit::WebTextDirection; |
18 using WebKit::WebURLError; | 17 using WebKit::WebURLError; |
19 | 18 |
20 typedef RenderViewTest FormAutocompleteTest; | 19 typedef RenderViewTest FormAutocompleteTest; |
21 | 20 |
22 // Tests that submitting a form generates a FormSubmitted message | 21 // Tests that submitting a form generates a FormSubmitted message |
23 // with the form fields. | 22 // with the form fields. |
24 TEST_F(FormAutocompleteTest, NormalFormSubmit) { | 23 TEST_F(FormAutocompleteTest, NormalFormSubmit) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 EXPECT_FALSE(form.autoComplete()); | 110 EXPECT_FALSE(form.autoComplete()); |
112 | 111 |
113 // Submit the form. | 112 // Submit the form. |
114 ExecuteJavaScript("document.getElementById('myForm').submit();"); | 113 ExecuteJavaScript("document.getElementById('myForm').submit();"); |
115 ProcessPendingMessages(); | 114 ProcessPendingMessages(); |
116 | 115 |
117 // No FormSubmitted message should have been sent. | 116 // No FormSubmitted message should have been sent. |
118 EXPECT_FALSE(render_thread_.sink().GetFirstMessageMatching( | 117 EXPECT_FALSE(render_thread_.sink().GetFirstMessageMatching( |
119 ViewHostMsg_FormSubmitted::ID)); | 118 ViewHostMsg_FormSubmitted::ID)); |
120 } | 119 } |
OLD | NEW |