Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: base/base64_unittest.cc

Issue 399068: Move base64 from 'net/base' into 'base'. (Closed)
Patch Set: rebase Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/base64.cc ('k') | chrome/browser/chrome_plugin_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "net/base/base64.h" 5 #include "base/base64.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace { 8 namespace {
9 9
10 class Base64Test : public testing::Test { 10 class Base64Test : public testing::Test {
11 }; 11 };
12 12
13 } // namespace 13 } // namespace
14 14
15 TEST(Base64Test, Basic) { 15 TEST(Base64Test, Basic) {
16 const std::string kText = "hello world"; 16 const std::string kText = "hello world";
17 const std::string kBase64Text = "aGVsbG8gd29ybGQ="; 17 const std::string kBase64Text = "aGVsbG8gd29ybGQ=";
18 18
19 std::string encoded, decoded; 19 std::string encoded, decoded;
20 bool ok; 20 bool ok;
21 21
22 ok = net::Base64Encode(kText, &encoded); 22 ok = base::Base64Encode(kText, &encoded);
23 EXPECT_TRUE(ok); 23 EXPECT_TRUE(ok);
24 EXPECT_EQ(kBase64Text, encoded); 24 EXPECT_EQ(kBase64Text, encoded);
25 25
26 ok = net::Base64Decode(encoded, &decoded); 26 ok = base::Base64Decode(encoded, &decoded);
27 EXPECT_TRUE(ok); 27 EXPECT_TRUE(ok);
28 EXPECT_EQ(kText, decoded); 28 EXPECT_EQ(kText, decoded);
29 } 29 }
OLDNEW
« no previous file with comments | « base/base64.cc ('k') | chrome/browser/chrome_plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698