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

Side by Side Diff: components/policy/core/browser/android/android_combined_policy_provider_unittest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <jni.h> 5 #include <jni.h>
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 ConvertUTF8ToJavaString(env, "TestPolicy"); 70 ConvertUTF8ToJavaString(env, "TestPolicy");
71 ScopedJavaLocalRef<jstring> jvalue = 71 ScopedJavaLocalRef<jstring> jvalue =
72 ConvertUTF8ToJavaString(env, "TestValue"); 72 ConvertUTF8ToJavaString(env, "TestValue");
73 manager.GetPolicyConverterForTesting()->SetPolicyString(env, nullptr, jpolicy, 73 manager.GetPolicyConverterForTesting()->SetPolicyString(env, nullptr, jpolicy,
74 jvalue); 74 jvalue);
75 manager.FlushPolicies(env, nullptr); 75 manager.FlushPolicies(env, nullptr);
76 const PolicyBundle& bundle = manager.policies(); 76 const PolicyBundle& bundle = manager.policies();
77 const PolicyMap& map = bundle.Get(ns); 77 const PolicyMap& map = bundle.Get(ns);
78 const base::Value* value = map.GetValue("TestPolicy"); 78 const base::Value* value = map.GetValue("TestPolicy");
79 ASSERT_NE(nullptr, value); 79 ASSERT_NE(nullptr, value);
80 EXPECT_EQ(base::Value::TYPE_STRING, value->GetType()); 80 EXPECT_EQ(base::Value::Type::STRING, value->GetType());
81 std::string out_value; 81 std::string out_value;
82 EXPECT_TRUE(value->GetAsString(&out_value)); 82 EXPECT_TRUE(value->GetAsString(&out_value));
83 EXPECT_EQ("TestValue", out_value); 83 EXPECT_EQ("TestValue", out_value);
84 // If the manager is deleted (by going out of scope) without being shutdown 84 // If the manager is deleted (by going out of scope) without being shutdown
85 // first it DCHECKs. 85 // first it DCHECKs.
86 manager.Shutdown(); 86 manager.Shutdown();
87 } 87 }
88 88
89 } // namespace android 89 } // namespace android
90 90
91 } // namespace policy 91 } // namespace policy
OLDNEW
« no previous file with comments | « components/nacl/renderer/json_manifest.cc ('k') | components/policy/core/browser/android/policy_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698