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

Side by Side Diff: ppapi/tests/test_ime_input_event.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_flash_file.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/tests/test_ime_input_event.h" 5 #include "ppapi/tests/test_ime_input_event.h"
6 6
7 #include "ppapi/c/dev/ppb_ime_input_event_dev.h" 7 #include "ppapi/c/dev/ppb_ime_input_event_dev.h"
8 #include "ppapi/c/dev/ppb_testing_dev.h" 8 #include "ppapi/c/dev/ppb_testing_dev.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_input_event.h" 10 #include "ppapi/c/ppb_input_event.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 segments.push_back(0U); 350 segments.push_back(0U);
351 segments.push_back(3U); 351 segments.push_back(3U);
352 segments.push_back(6U); 352 segments.push_back(6U);
353 segments.push_back(9U); 353 segments.push_back(9U);
354 pp::InputEvent update_event = CreateImeCompositionUpdateEvent( 354 pp::InputEvent update_event = CreateImeCompositionUpdateEvent(
355 kCompositionText, segments, 1, std::make_pair(3U, 6U)); 355 kCompositionText, segments, 1, std::make_pair(3U, 6U));
356 356
357 expected_events_.clear(); 357 expected_events_.clear();
358 expected_events_.push_back(CreateImeCompositionStartEvent()); 358 expected_events_.push_back(CreateImeCompositionStartEvent());
359 expected_events_.push_back(update_event); 359 expected_events_.push_back(update_event);
360 expected_events_.push_back(CreateImeCompositionEndEvent("")); 360 expected_events_.push_back(CreateImeCompositionEndEvent(std::string()));
361 361
362 // Simulate the case when IME canceled composition. 362 // Simulate the case when IME canceled composition.
363 ASSERT_TRUE(SimulateInputEvent(update_event)); 363 ASSERT_TRUE(SimulateInputEvent(update_event));
364 ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(""))); 364 ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(std::string())));
365 365
366 ASSERT_TRUE(expected_events_.empty()); 366 ASSERT_TRUE(expected_events_.empty());
367 PASS(); 367 PASS();
368 } 368 }
369 369
370 std::string TestImeInputEvent::TestImeUnawareCommit() { 370 std::string TestImeInputEvent::TestImeUnawareCommit() {
371 GetFocusBySimulatingMouseClick(); 371 GetFocusBySimulatingMouseClick();
372 372
373 input_event_interface_->ClearInputEventRequest(instance_->pp_instance(), 373 input_event_interface_->ClearInputEventRequest(instance_->pp_instance(),
374 PP_INPUTEVENT_CLASS_IME); 374 PP_INPUTEVENT_CLASS_IME);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 segments.push_back(3U); 410 segments.push_back(3U);
411 segments.push_back(6U); 411 segments.push_back(6U);
412 segments.push_back(9U); 412 segments.push_back(9U);
413 pp::InputEvent update_event = CreateImeCompositionUpdateEvent( 413 pp::InputEvent update_event = CreateImeCompositionUpdateEvent(
414 kCompositionText, segments, 1, std::make_pair(3U, 6U)); 414 kCompositionText, segments, 1, std::make_pair(3U, 6U));
415 415
416 expected_events_.clear(); 416 expected_events_.clear();
417 417
418 // Test for IME-unaware plugins. Cancel won't issue any events. 418 // Test for IME-unaware plugins. Cancel won't issue any events.
419 ASSERT_TRUE(SimulateInputEvent(update_event)); 419 ASSERT_TRUE(SimulateInputEvent(update_event));
420 ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(""))); 420 ASSERT_TRUE(SimulateInputEvent(CreateImeCompositionEndEvent(std::string())));
421 421
422 ASSERT_TRUE(expected_events_.empty()); 422 ASSERT_TRUE(expected_events_.empty());
423 PASS(); 423 PASS();
424 } 424 }
425 425
OLDNEW
« no previous file with comments | « ppapi/tests/test_flash_file.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698