| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/service/cloud_print/cloud_print_token_store.h" | 5 #include "chrome/service/cloud_print/cloud_print_token_store.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 TEST(CloudPrintTokenStoreTest, Basic) { | 9 TEST(CloudPrintTokenStoreTest, Basic) { |
| 10 EXPECT_EQ(NULL, CloudPrintTokenStore::current()); | 10 EXPECT_EQ(NULL, CloudPrintTokenStore::current()); |
| 11 CloudPrintTokenStore* store = new CloudPrintTokenStore; | 11 CloudPrintTokenStore* store = new CloudPrintTokenStore; |
| 12 EXPECT_EQ(store, CloudPrintTokenStore::current()); | 12 EXPECT_EQ(store, CloudPrintTokenStore::current()); |
| 13 CloudPrintTokenStore::current()->SetToken("myclientlogintoken", false); | 13 CloudPrintTokenStore::current()->SetToken("myclientlogintoken"); |
| 14 EXPECT_EQ(CloudPrintTokenStore::current()->token(), "myclientlogintoken"); | 14 EXPECT_EQ(CloudPrintTokenStore::current()->token(), "myclientlogintoken"); |
| 15 EXPECT_FALSE(CloudPrintTokenStore::current()->token_is_oauth()); | |
| 16 CloudPrintTokenStore::current()->SetToken("myoauth2token", true); | |
| 17 EXPECT_EQ(CloudPrintTokenStore::current()->token(), "myoauth2token"); | |
| 18 EXPECT_TRUE(CloudPrintTokenStore::current()->token_is_oauth()); | |
| 19 delete store; | 15 delete store; |
| 20 EXPECT_EQ(NULL, CloudPrintTokenStore::current()); | 16 EXPECT_EQ(NULL, CloudPrintTokenStore::current()); |
| 21 } | 17 } |
| 22 | 18 |
| OLD | NEW |