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

Side by Side Diff: chrome/browser/component_updater/test/component_installers_unittest.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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
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 "chrome/browser/component_updater/flash_component_installer.h" 5 #include "chrome/browser/component_updater/flash_component_installer.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; 58 ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test;
59 ppapi::TestGlobals test_globals(per_thread_for_test); 59 ppapi::TestGlobals test_globals(per_thread_for_test);
60 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals); 60 ppapi::PpapiGlobals::SetPpapiGlobalsOnThreadForTest(&test_globals);
61 61
62 // The test directory is chrome/test/data/components/flapper. 62 // The test directory is chrome/test/data/components/flapper.
63 base::FilePath manifest; 63 base::FilePath manifest;
64 PathService::Get(chrome::DIR_TEST_DATA, &manifest); 64 PathService::Get(chrome::DIR_TEST_DATA, &manifest);
65 manifest = manifest.Append(kDataPath); 65 manifest = manifest.Append(kDataPath);
66 manifest = manifest.AppendASCII("manifest.json"); 66 manifest = manifest.AppendASCII("manifest.json");
67 67
68 if (!file_util::PathExists(manifest)) { 68 if (!base::PathExists(manifest)) {
69 LOG(WARNING) << "No test manifest available. Skipping."; 69 LOG(WARNING) << "No test manifest available. Skipping.";
70 return; 70 return;
71 } 71 }
72 72
73 JSONFileValueSerializer serializer(manifest); 73 JSONFileValueSerializer serializer(manifest);
74 std::string error; 74 std::string error;
75 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>( 75 scoped_ptr<base::DictionaryValue> root(static_cast<base::DictionaryValue*>(
76 serializer.Deserialize(NULL, &error))); 76 serializer.Deserialize(NULL, &error)));
77 ASSERT_TRUE(root); 77 ASSERT_TRUE(root);
78 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); 78 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
79 79
80 // This checks that the whole manifest is compatible. 80 // This checks that the whole manifest is compatible.
81 Version version; 81 Version version;
82 EXPECT_TRUE(CheckPepperFlashManifest(*root, &version)); 82 EXPECT_TRUE(CheckPepperFlashManifest(*root, &version));
83 EXPECT_TRUE(version.IsValid()); 83 EXPECT_TRUE(version.IsValid());
84 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698