| 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 4202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4213 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); | 4213 webViewHelper.webView()->settings()->setAsynchronousSpellCheckingEnabled(tru
e); |
| 4214 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); | 4214 webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true); |
| 4215 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); | 4215 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); |
| 4216 | 4216 |
| 4217 element->focus(); | 4217 element->focus(); |
| 4218 document->execCommand("InsertText", false, "_wellcome_."); | 4218 document->execCommand("InsertText", false, "_wellcome_."); |
| 4219 | 4219 |
| 4220 const int allTextBeginOffset = 0; | 4220 const int allTextBeginOffset = 0; |
| 4221 const int allTextLength = 11; | 4221 const int allTextLength = 11; |
| 4222 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); | 4222 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); |
| 4223 RefPtr<Range> selectionRange = frame->frame()->selection().toNormalizedRange
(); | 4223 RefPtrWillBeRawPtr<Range> selectionRange = frame->frame()->selection().toNor
malizedRange(); |
| 4224 | 4224 |
| 4225 EXPECT_EQ(1, spellcheck.numberOfTimesChecked()); | 4225 EXPECT_EQ(1, spellcheck.numberOfTimesChecked()); |
| 4226 EXPECT_EQ(1U, document->markers().markersInRange(selectionRange.get(), Docum
entMarker::Spelling).size()); | 4226 EXPECT_EQ(1U, document->markers().markersInRange(selectionRange.get(), Docum
entMarker::Spelling).size()); |
| 4227 | 4227 |
| 4228 frame->replaceMisspelledRange("welcome"); | 4228 frame->replaceMisspelledRange("welcome"); |
| 4229 EXPECT_EQ("_welcome_.", frame->contentAsText(std::numeric_limits<size_t>::ma
x()).utf8()); | 4229 EXPECT_EQ("_welcome_.", frame->contentAsText(std::numeric_limits<size_t>::ma
x()).utf8()); |
| 4230 } | 4230 } |
| 4231 | 4231 |
| 4232 TEST_F(WebFrameTest, RemoveSpellingMarkers) | 4232 TEST_F(WebFrameTest, RemoveSpellingMarkers) |
| 4233 { | 4233 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 4246 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); | 4246 webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::Editing
BehaviorWin); |
| 4247 | 4247 |
| 4248 element->focus(); | 4248 element->focus(); |
| 4249 document->execCommand("InsertText", false, "_wellcome_."); | 4249 document->execCommand("InsertText", false, "_wellcome_."); |
| 4250 | 4250 |
| 4251 frame->removeSpellingMarkers(); | 4251 frame->removeSpellingMarkers(); |
| 4252 | 4252 |
| 4253 const int allTextBeginOffset = 0; | 4253 const int allTextBeginOffset = 0; |
| 4254 const int allTextLength = 11; | 4254 const int allTextLength = 11; |
| 4255 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); | 4255 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); |
| 4256 RefPtr<Range> selectionRange = frame->frame()->selection().toNormalizedRange
(); | 4256 RefPtrWillBeRawPtr<Range> selectionRange = frame->frame()->selection().toNor
malizedRange(); |
| 4257 | 4257 |
| 4258 EXPECT_EQ(0U, document->markers().markersInRange(selectionRange.get(), Docum
entMarker::Spelling).size()); | 4258 EXPECT_EQ(0U, document->markers().markersInRange(selectionRange.get(), Docum
entMarker::Spelling).size()); |
| 4259 } | 4259 } |
| 4260 | 4260 |
| 4261 TEST_F(WebFrameTest, MarkerHashIdentifiers) { | 4261 TEST_F(WebFrameTest, MarkerHashIdentifiers) { |
| 4262 registerMockedHttpURLLoad("spell.html"); | 4262 registerMockedHttpURLLoad("spell.html"); |
| 4263 FrameTestHelpers::WebViewHelper webViewHelper; | 4263 FrameTestHelpers::WebViewHelper webViewHelper; |
| 4264 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); | 4264 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); |
| 4265 | 4265 |
| 4266 static const uint32_t kHash = 42; | 4266 static const uint32_t kHash = 42; |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5482 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); | 5482 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); |
| 5483 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); | 5483 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); |
| 5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); | 5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); |
| 5485 | 5485 |
| 5486 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); | 5486 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); |
| 5487 EXPECT_TRUE(anonymousBlock->isAnonymous()); | 5487 EXPECT_TRUE(anonymousBlock->isAnonymous()); |
| 5488 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); | 5488 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); |
| 5489 } | 5489 } |
| 5490 | 5490 |
| 5491 } // namespace | 5491 } // namespace |
| OLD | NEW |