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

Side by Side Diff: webkit/renderer/cpp_variant_unittest.cc

Issue 61553006: Rename WebKit namespace to blink (part 5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « webkit/renderer/cpp_variant.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/WebKit/public/web/WebBindings.h" 11 #include "third_party/WebKit/public/web/WebBindings.h"
12 #include "webkit/renderer/cpp_variant.h" 12 #include "webkit/renderer/cpp_variant.h"
13 13
14 using WebKit::WebBindings; 14 using blink::WebBindings;
15 using webkit_glue::CppVariant; 15 using webkit_glue::CppVariant;
16 16
17 // Creates a std::string from an NPVariant of string type. If the NPVariant 17 // Creates a std::string from an NPVariant of string type. If the NPVariant
18 // is not a string, empties the std::string. 18 // is not a string, empties the std::string.
19 void MakeStdString(const NPVariant& np, std::string* std_string) { 19 void MakeStdString(const NPVariant& np, std::string* std_string) {
20 if (np.type == NPVariantType_String) { 20 if (np.type == NPVariantType_String) {
21 const char* chars = 21 const char* chars =
22 reinterpret_cast<const char*>(np.value.stringValue.UTF8Characters); 22 reinterpret_cast<const char*>(np.value.stringValue.UTF8Characters);
23 (*std_string).assign(chars, np.value.stringValue.UTF8Length); 23 (*std_string).assign(chars, np.value.stringValue.UTF8Length);
24 } else { 24 } else {
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 EXPECT_TRUE(cpp_vector[1].isBool()); 505 EXPECT_TRUE(cpp_vector[1].isBool());
506 EXPECT_EQ(true, cpp_vector[1].ToBoolean()); 506 EXPECT_EQ(true, cpp_vector[1].ToBoolean());
507 507
508 EXPECT_TRUE(cpp_vector[2].isNull()); 508 EXPECT_TRUE(cpp_vector[2].isNull());
509 509
510 EXPECT_TRUE(cpp_vector[3].isString()); 510 EXPECT_TRUE(cpp_vector[3].isString());
511 CheckString("string", cpp_vector[3]); 511 CheckString("string", cpp_vector[3]);
512 512
513 WebBindings::releaseObject(obj); 513 WebBindings::releaseObject(obj);
514 } 514 }
OLDNEW
« no previous file with comments | « webkit/renderer/cpp_variant.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698