OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 5327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5338 TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) | 5338 TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) |
5339 { | 5339 { |
5340 registerMockedHttpURLLoad("spell.html"); | 5340 registerMockedHttpURLLoad("spell.html"); |
5341 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5341 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5342 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); | 5342 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); |
5343 | 5343 |
5344 StubbornSpellCheckClient spellcheck; | 5344 StubbornSpellCheckClient spellcheck; |
5345 webViewHelper.webView()->setSpellCheckClient(&spellcheck); | 5345 webViewHelper.webView()->setSpellCheckClient(&spellcheck); |
5346 | 5346 |
5347 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); | 5347 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); |
5348 WebInputElement webInputElement = frame->document().getElementById("data").t
o<WebInputElement>(); | |
5349 Document* document = frame->frame()->document(); | 5348 Document* document = frame->frame()->document(); |
5350 Element* element = document->getElementById("data"); | 5349 Element* element = document->getElementById("data"); |
5351 | 5350 |
5352 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); | 5351 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); |
5353 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); | 5352 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); |
5354 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); | 5353 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); |
5355 | 5354 |
5356 element->focus(); | 5355 element->focus(); |
5357 NonThrowableExceptionState exceptionState; | 5356 NonThrowableExceptionState exceptionState; |
5358 document->execCommand("InsertText", false, "wellcome ", exceptionState); | 5357 document->execCommand("InsertText", false, "wellcome ", exceptionState); |
5359 EXPECT_FALSE(exceptionState.hadException()); | 5358 EXPECT_FALSE(exceptionState.hadException()); |
5360 webInputElement.setSelectionRange(0, 0); | |
5361 document->execCommand("InsertText", false, "he", exceptionState); | 5359 document->execCommand("InsertText", false, "he", exceptionState); |
5362 EXPECT_FALSE(exceptionState.hadException()); | 5360 EXPECT_FALSE(exceptionState.hadException()); |
5363 | 5361 |
5364 spellcheck.kick(); | 5362 spellcheck.kick(); |
5365 | 5363 |
5366 WebVector<uint32_t> documentMarkers; | 5364 WebVector<uint32_t> documentMarkers; |
5367 webViewHelper.webView()->spellingMarkers(&documentMarkers); | 5365 webViewHelper.webView()->spellingMarkers(&documentMarkers); |
5368 EXPECT_EQ(0U, documentMarkers.size()); | 5366 EXPECT_EQ(0U, documentMarkers.size()); |
5369 } | 5367 } |
5370 | 5368 |
(...skipping 22 matching lines...) Expand all Loading... |
5393 TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) | 5391 TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) |
5394 { | 5392 { |
5395 registerMockedHttpURLLoad("spell.html"); | 5393 registerMockedHttpURLLoad("spell.html"); |
5396 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5394 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5397 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); | 5395 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); |
5398 | 5396 |
5399 StubbornSpellCheckClient spellcheck; | 5397 StubbornSpellCheckClient spellcheck; |
5400 webViewHelper.webView()->setSpellCheckClient(&spellcheck); | 5398 webViewHelper.webView()->setSpellCheckClient(&spellcheck); |
5401 | 5399 |
5402 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); | 5400 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); |
5403 WebInputElement webInputElement = frame->document().getElementById("data").t
o<WebInputElement>(); | |
5404 Document* document = frame->frame()->document(); | 5401 Document* document = frame->frame()->document(); |
5405 Element* element = document->getElementById("data"); | 5402 Element* element = document->getElementById("data"); |
5406 | 5403 |
5407 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); | 5404 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); |
5408 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); | 5405 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); |
5409 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); | 5406 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); |
5410 | 5407 |
5411 element->focus(); | 5408 element->focus(); |
5412 NonThrowableExceptionState exceptionState; | 5409 NonThrowableExceptionState exceptionState; |
5413 document->execCommand("InsertText", false, "welcome ", exceptionState); | 5410 document->execCommand("InsertText", false, "welcome ", exceptionState); |
(...skipping 11 matching lines...) Expand all Loading... |
5425 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) | 5422 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) |
5426 { | 5423 { |
5427 registerMockedHttpURLLoad("spell.html"); | 5424 registerMockedHttpURLLoad("spell.html"); |
5428 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5425 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5429 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); | 5426 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); |
5430 | 5427 |
5431 StubbornSpellCheckClient spellcheck; | 5428 StubbornSpellCheckClient spellcheck; |
5432 webViewHelper.webView()->setSpellCheckClient(&spellcheck); | 5429 webViewHelper.webView()->setSpellCheckClient(&spellcheck); |
5433 | 5430 |
5434 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); | 5431 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main
Frame()); |
5435 WebInputElement webInputElement = frame->document().getElementById("data").t
o<WebInputElement>(); | |
5436 Document* document = frame->frame()->document(); | 5432 Document* document = frame->frame()->document(); |
5437 Element* element = document->getElementById("data"); | 5433 Element* element = document->getElementById("data"); |
5438 | 5434 |
5439 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); | 5435 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); |
5440 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); | 5436 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); |
5441 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); | 5437 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); |
5442 | 5438 |
5443 element->focus(); | 5439 element->focus(); |
5444 NonThrowableExceptionState exceptionState; | 5440 NonThrowableExceptionState exceptionState; |
5445 document->execCommand("InsertText", false, "wellcome ", exceptionState); | 5441 document->execCommand("InsertText", false, "wellcome ", exceptionState); |
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8222 | 8218 |
8223 TEST_F(WebFrameTest, MaxFramesDetach) | 8219 TEST_F(WebFrameTest, MaxFramesDetach) |
8224 { | 8220 { |
8225 registerMockedHttpURLLoad("max-frames-detach.html"); | 8221 registerMockedHttpURLLoad("max-frames-detach.html"); |
8226 FrameTestHelpers::WebViewHelper webViewHelper; | 8222 FrameTestHelpers::WebViewHelper webViewHelper; |
8227 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8223 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
8228 webViewImpl->mainFrameImpl()->collectGarbage(); | 8224 webViewImpl->mainFrameImpl()->collectGarbage(); |
8229 } | 8225 } |
8230 | 8226 |
8231 } // namespace blink | 8227 } // namespace blink |
OLD | NEW |