Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / pairing / fake_controller_pairing_controller.cc
index 0b05ee6..0d30e06 100644 (file)
@@ -82,11 +82,9 @@ void FakeControllerPairingController::ApplyConfig(const std::string& config) {
       base::SplitStringIntoKeyValuePairs(dict["discovery"], '-', '~', &events))
       << "Wrong 'discovery' format.";
   DiscoveryScenario scenario;
-  for (base::StringPairs::const_iterator event = events.begin();
-       event != events.end();
-       ++event) {
-    std::string type = event->first;
-    std::string device_id = event->second;
+  for (const auto& event : events) {
+    const std::string& type = event.first;
+    const std::string& device_id = event.second;
     CHECK(type == "F" || type == "L" || type == "N")
         << "Wrong discovery event type.";
     CHECK(!device_id.empty() || type == "N") << "Empty device ID.";
@@ -221,7 +219,7 @@ void FakeControllerPairingController::OnAuthenticationDone(
 }
 
 void FakeControllerPairingController::StartSession() {
-  CHECK(current_stage_ == STAGE_PAIRING_DONE);
+  CHECK(current_stage_ == STAGE_HOST_ENROLLMENT_SUCCESS);
   ChangeStage(STAGE_FINISHED);
 }
 
@@ -317,7 +315,7 @@ void FakeControllerPairingController::PairingStageChanged(Stage new_stage) {
         enrollment_should_fail_ = false;
         next_stage = STAGE_HOST_ENROLLMENT_ERROR;
       } else {
-        next_stage = STAGE_PAIRING_DONE;
+        next_stage = STAGE_HOST_ENROLLMENT_SUCCESS;
       }
       break;
     }