| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 3446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3457 frame->inputMethodController(); | 3457 frame->inputMethodController(); |
| 3458 Document* document = frame->frame()->document(); | 3458 Document* document = frame->frame()->document(); |
| 3459 | 3459 |
| 3460 // (A) <input> | 3460 // (A) <input> |
| 3461 // (A.1) Verifies autocorrect/autocomplete/spellcheck flags are Off and | 3461 // (A.1) Verifies autocorrect/autocomplete/spellcheck flags are Off and |
| 3462 // autocapitalize is set to none. | 3462 // autocapitalize is set to none. |
| 3463 HTMLInputElement* inputElement = | 3463 HTMLInputElement* inputElement = |
| 3464 toHTMLInputElement(document->getElementById("input")); | 3464 toHTMLInputElement(document->getElementById("input")); |
| 3465 document->setFocusedElement( | 3465 document->setFocusedElement( |
| 3466 inputElement, | 3466 inputElement, |
| 3467 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr)); | 3467 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, |
| 3468 InputDeviceCapabilities::Null)); |
| 3468 webViewImpl->setFocus(true); | 3469 webViewImpl->setFocus(true); |
| 3469 WebTextInputInfo info1 = activeInputMethodController->textInputInfo(); | 3470 WebTextInputInfo info1 = activeInputMethodController->textInputInfo(); |
| 3470 EXPECT_EQ(WebTextInputFlagAutocompleteOff | WebTextInputFlagAutocorrectOff | | 3471 EXPECT_EQ(WebTextInputFlagAutocompleteOff | WebTextInputFlagAutocorrectOff | |
| 3471 WebTextInputFlagSpellcheckOff | | 3472 WebTextInputFlagSpellcheckOff | |
| 3472 WebTextInputFlagAutocapitalizeNone, | 3473 WebTextInputFlagAutocapitalizeNone, |
| 3473 info1.flags); | 3474 info1.flags); |
| 3474 | 3475 |
| 3475 // (A.2) Verifies autocorrect/autocomplete/spellcheck flags are On and | 3476 // (A.2) Verifies autocorrect/autocomplete/spellcheck flags are On and |
| 3476 // autocapitalize is set to sentences. | 3477 // autocapitalize is set to sentences. |
| 3477 inputElement = toHTMLInputElement(document->getElementById("input2")); | 3478 inputElement = toHTMLInputElement(document->getElementById("input2")); |
| 3478 document->setFocusedElement( | 3479 document->setFocusedElement( |
| 3479 inputElement, | 3480 inputElement, |
| 3480 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr)); | 3481 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, |
| 3482 InputDeviceCapabilities::Null)); |
| 3481 webViewImpl->setFocus(true); | 3483 webViewImpl->setFocus(true); |
| 3482 WebTextInputInfo info2 = activeInputMethodController->textInputInfo(); | 3484 WebTextInputInfo info2 = activeInputMethodController->textInputInfo(); |
| 3483 EXPECT_EQ(WebTextInputFlagAutocompleteOn | WebTextInputFlagAutocorrectOn | | 3485 EXPECT_EQ(WebTextInputFlagAutocompleteOn | WebTextInputFlagAutocorrectOn | |
| 3484 WebTextInputFlagSpellcheckOn | | 3486 WebTextInputFlagSpellcheckOn | |
| 3485 WebTextInputFlagAutocapitalizeSentences, | 3487 WebTextInputFlagAutocapitalizeSentences, |
| 3486 info2.flags); | 3488 info2.flags); |
| 3487 | 3489 |
| 3488 // (B) <textarea> Verifies the default text input flags are | 3490 // (B) <textarea> Verifies the default text input flags are |
| 3489 // WebTextInputFlagAutocapitalizeSentences. | 3491 // WebTextInputFlagAutocapitalizeSentences. |
| 3490 HTMLTextAreaElement* textAreaElement = | 3492 HTMLTextAreaElement* textAreaElement = |
| 3491 toHTMLTextAreaElement(document->getElementById("textarea")); | 3493 toHTMLTextAreaElement(document->getElementById("textarea")); |
| 3492 document->setFocusedElement( | 3494 document->setFocusedElement( |
| 3493 textAreaElement, | 3495 textAreaElement, |
| 3494 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr)); | 3496 FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, |
| 3497 InputDeviceCapabilities::Null)); |
| 3495 webViewImpl->setFocus(true); | 3498 webViewImpl->setFocus(true); |
| 3496 WebTextInputInfo info3 = activeInputMethodController->textInputInfo(); | 3499 WebTextInputInfo info3 = activeInputMethodController->textInputInfo(); |
| 3497 EXPECT_EQ(WebTextInputFlagAutocapitalizeSentences, info3.flags); | 3500 EXPECT_EQ(WebTextInputFlagAutocapitalizeSentences, info3.flags); |
| 3498 | 3501 |
| 3499 // (C) Verifies the WebTextInputInfo's don't equal. | 3502 // (C) Verifies the WebTextInputInfo's don't equal. |
| 3500 EXPECT_FALSE(info1.equals(info2)); | 3503 EXPECT_FALSE(info1.equals(info2)); |
| 3501 EXPECT_FALSE(info2.equals(info3)); | 3504 EXPECT_FALSE(info2.equals(info3)); |
| 3502 | 3505 |
| 3503 // Free the webView before freeing the NonUserInputTextUpdateWebViewClient. | 3506 // Free the webView before freeing the NonUserInputTextUpdateWebViewClient. |
| 3504 m_webViewHelper.reset(); | 3507 m_webViewHelper.reset(); |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4285 EXPECT_EQ(expectedWidth, vwElement->offsetWidth()); | 4288 EXPECT_EQ(expectedWidth, vwElement->offsetWidth()); |
| 4286 EXPECT_EQ(expectedHeight, vwElement->offsetHeight()); | 4289 EXPECT_EQ(expectedHeight, vwElement->offsetHeight()); |
| 4287 | 4290 |
| 4288 webView->resize(WebSize(800, 600)); | 4291 webView->resize(WebSize(800, 600)); |
| 4289 frame->printEnd(); | 4292 frame->printEnd(); |
| 4290 | 4293 |
| 4291 EXPECT_EQ(800, vwElement->offsetWidth()); | 4294 EXPECT_EQ(800, vwElement->offsetWidth()); |
| 4292 } | 4295 } |
| 4293 | 4296 |
| 4294 } // namespace blink | 4297 } // namespace blink |
| OLD | NEW |