OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/logging.h" |
| 6 #include "base/scoped_ptr.h" |
| 7 #include "remoting/client/client_config.h" |
| 8 #include "remoting/client/client_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 namespace remoting { |
| 12 |
| 13 // TODO(ajwong): Once ChromotingPlugin stablizes a little more, come up with |
| 14 // sane unittests. |
| 15 class ClientUtilTest : public testing::Test { |
| 16 protected: |
| 17 virtual void SetUp() { |
| 18 } |
| 19 }; |
| 20 |
| 21 TEST_F(ClientUtilTest, GetLoginInfoFromUrlParams) { |
| 22 const char url[] = "chromotocol://hostid?user=auser&auth=someauth&jid=ajid"; |
| 23 std::string user_id; |
| 24 std::string auth_token; |
| 25 std::string host_jid; |
| 26 ClientConfig config; |
| 27 |
| 28 ASSERT_TRUE( |
| 29 GetLoginInfoFromUrlParams(url, &config)); |
| 30 |
| 31 EXPECT_EQ("auser", config.username()); |
| 32 EXPECT_EQ("someauth", config.auth_token()); |
| 33 EXPECT_EQ("ajid", config.host_jid()); |
| 34 } |
| 35 |
| 36 } // namespace remoting |
OLD | NEW |