OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
7 #include "remoting/client/client_config.h" | 7 #include "remoting/client/client_config.h" |
8 #include "remoting/client/client_util.h" | 8 #include "remoting/client/client_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 // TODO(ajwong): Fill this out. | 13 // TODO(ajwong): Once ChromotingPlugin stablizes a little more, come up with |
| 14 // sane unittests. |
14 class ClientUtilTest : public testing::Test { | 15 class ClientUtilTest : public testing::Test { |
15 protected: | 16 protected: |
16 virtual void SetUp() { | 17 virtual void SetUp() { |
17 } | 18 } |
18 }; | 19 }; |
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(GetLoginInfoFromUrlParams(url, &config)); |
| 29 |
| 30 EXPECT_EQ("auser", config.username); |
| 31 EXPECT_EQ("someauth", config.auth_token); |
| 32 EXPECT_EQ("ajid", config.host_jid); |
| 33 } |
| 34 |
20 } // namespace remoting | 35 } // namespace remoting |
OLD | NEW |