Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: Source/testing/runner/MockGrammarCheck.cpp

Issue 49613006: Refactoring inline_spelling_markers.html to use async path for spellcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Use resources/js-test.js and remove js-test-post.js Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/platform/win/editing/spelling/inline_spelling_markers-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } grammarErrors[] = { 58 } grammarErrors[] = {
59 {"I have a issue.", 7, 1}, 59 {"I have a issue.", 7, 1},
60 {"I have an grape.", 7, 2}, 60 {"I have an grape.", 7, 2},
61 {"I have an kiwi.", 7, 2}, 61 {"I have an kiwi.", 7, 2},
62 {"I have an muscat.", 7, 2}, 62 {"I have an muscat.", 7, 2},
63 {"You has the right.", 4, 3}, 63 {"You has the right.", 4, 3},
64 {"apple orange zz.", 0, 16}, 64 {"apple orange zz.", 0, 16},
65 {"apple zz orange.", 0, 16}, 65 {"apple zz orange.", 0, 16},
66 {"apple,zz,orange.", 0, 16}, 66 {"apple,zz,orange.", 0, 16},
67 {"orange,zz,apple.", 0, 16}, 67 {"orange,zz,apple.", 0, 16},
68 {"the the adlj adaasj sdklj. there there", 0, 38}, 68 {"the the adlj adaasj sdklj. there there", 4, 3},
69 {"the the adlj adaasj sdklj. there there", 33, 5},
69 {"zz apple orange.", 0, 16}, 70 {"zz apple orange.", 0, 16},
70 }; 71 };
71 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(grammarErrors); ++i) { 72 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(grammarErrors); ++i) {
72 size_t offset = 0; 73 size_t offset = 0;
73 string16 error(grammarErrors[i].text, grammarErrors[i].text + strlen(gra mmarErrors[i].text)); 74 string16 error(grammarErrors[i].text, grammarErrors[i].text + strlen(gra mmarErrors[i].text));
74 while ((offset = stringText.find(error, offset)) != string16::npos) { 75 while ((offset = stringText.find(error, offset)) != string16::npos) {
75 results->push_back(WebTextCheckingResult(WebTextDecorationTypeGramma r, offset + grammarErrors[i].location, grammarErrors[i].length)); 76 results->push_back(WebTextCheckingResult(WebTextDecorationTypeGramma r, offset + grammarErrors[i].location, grammarErrors[i].length));
76 offset += grammarErrors[i].length; 77 offset += grammarErrors[i].length;
77 } 78 }
78 } 79 }
79 return false; 80 return false;
80 } 81 }
81 82
82 } 83 }
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/editing/spelling/inline_spelling_markers-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698