| 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/plugin/chromoting_plugin.h" | 7 #include "remoting/client/plugin/chromoting_plugin.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 | 11 |
| 12 // TODO(ajwong): Once ChromotingPlugin stablizes a little more, come up with | 12 // TODO(ajwong): Once ChromotingPlugin stablizes a little more, come up with |
| 13 // sane unittests. | 13 // sane unittests. |
| 14 class ChromotingPluginTest : public testing::Test { | 14 class ChromotingPluginTest : public testing::Test { |
| 15 protected: | 15 protected: |
| 16 virtual void SetUp() { | 16 virtual void SetUp() { |
| 17 } | 17 } |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 TEST_F(ChromotingPluginTest, ParseUrl) { | |
| 21 const char url[] = "chromotocol://hostid?user=auser&auth=someauth&jid=ajid"; | |
| 22 std::string user_id; | |
| 23 std::string auth_token; | |
| 24 std::string host_jid; | |
| 25 ASSERT_TRUE( | |
| 26 ChromotingPlugin::ParseUrl(url, &user_id, &auth_token, &host_jid)); | |
| 27 | |
| 28 EXPECT_EQ("auser", user_id); | |
| 29 EXPECT_EQ("someauth", auth_token); | |
| 30 EXPECT_EQ("ajid", host_jid); | |
| 31 } | |
| 32 | |
| 33 } // namespace remoting | 20 } // namespace remoting |
| OLD | NEW |