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

Side by Side Diff: components/test_runner/event_sender.cc

Issue 1280473002: Update ToLower/UpperASCII API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/test_runner/event_sender.h" 5 #include "components/test_runner/event_sender.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 isolate->ThrowException(v8::Exception::TypeError( 1358 isolate->ThrowException(v8::Exception::TypeError(
1359 gin::StringToV8(isolate, "Invalid web code."))); 1359 gin::StringToV8(isolate, "Invalid web code.")));
1360 return; 1360 return;
1361 } 1361 }
1362 text = code = web_code_str.at(0); 1362 text = code = web_code_str.at(0);
1363 needs_shift_key_modifier = NeedsShiftModifier(code); 1363 needs_shift_key_modifier = NeedsShiftModifier(code);
1364 if ((code & 0xFF) >= 'a' && (code & 0xFF) <= 'z') 1364 if ((code & 0xFF) >= 'a' && (code & 0xFF) <= 'z')
1365 code -= 'a' - 'A'; 1365 code -= 'a' - 'A';
1366 if ((code >= 'A' && code <= 'Z') || (code >= 'a' && code <= 'z')) { 1366 if ((code >= 'A' && code <= 'Z') || (code >= 'a' && code <= 'z')) {
1367 domString.assign("Key"); 1367 domString.assign("Key");
1368 domString.push_back(base::ToUpperASCII(code)); 1368 domString.push_back(
1369 base::ToUpperASCII(static_cast<base::char16>(code)));
1369 } else if (code >= '0' && code <= '9') { 1370 } else if (code >= '0' && code <= '9') {
1370 domString.assign("Digit"); 1371 domString.assign("Digit");
1371 domString.push_back(code); 1372 domString.push_back(code);
1372 } else if (code == ' ') { 1373 } else if (code == ' ') {
1373 domString.assign("Space"); 1374 domString.assign("Space");
1374 } else if (code == 9) { 1375 } else if (code == 9) {
1375 domString.assign("Tab"); 1376 domString.assign("Tab");
1376 } 1377 }
1377 generate_char = true; 1378 generate_char = true;
1378 } 1379 }
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 2546
2546 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { 2547 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) {
2547 if (WebPagePopup* popup = view_->pagePopup()) { 2548 if (WebPagePopup* popup = view_->pagePopup()) {
2548 if (!WebInputEvent::isKeyboardEventType(event.type)) 2549 if (!WebInputEvent::isKeyboardEventType(event.type))
2549 return popup->handleInputEvent(event); 2550 return popup->handleInputEvent(event);
2550 } 2551 }
2551 return view_->handleInputEvent(event); 2552 return view_->handleInputEvent(event);
2552 } 2553 }
2553 2554
2554 } // namespace test_runner 2555 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698