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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.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 // File contains browser tests for the fileBrowserHandler api. 5 // File contains browser tests for the fileBrowserHandler api.
6 6
7 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_a pi.h" 7 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_a pi.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 base::FilePath())); 257 base::FilePath()));
258 258
259 SetTestCases(&test_cases); 259 SetTestCases(&test_cases);
260 260
261 // Override extension function that will be used during the test. 261 // Override extension function that will be used during the test.
262 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction( 262 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction(
263 "fileBrowserHandlerInternal.selectFile", 263 "fileBrowserHandlerInternal.selectFile",
264 FileBrowserHandlerExtensionTest::TestSelectFileFunctionFactory)); 264 FileBrowserHandlerExtensionTest::TestSelectFileFunctionFactory));
265 265
266 // Selected path should still not exist. 266 // Selected path should still not exist.
267 ASSERT_FALSE(file_util::PathExists(selected_path)); 267 ASSERT_FALSE(base::PathExists(selected_path));
268 268
269 const Extension* extension = LoadExtension( 269 const Extension* extension = LoadExtension(
270 test_data_dir_.AppendASCII("file_browser/filehandler_create")); 270 test_data_dir_.AppendASCII("file_browser/filehandler_create"));
271 ASSERT_TRUE(extension) << message_; 271 ASSERT_TRUE(extension) << message_;
272 272
273 AddTmpMountPoint(extension->id()); 273 AddTmpMountPoint(extension->id());
274 274
275 ResultCatcher catcher; 275 ResultCatcher catcher;
276 276
277 GURL url = extension->GetResourceURL("test.html"); 277 GURL url = extension->GetResourceURL("test.html");
278 ui_test_utils::NavigateToURL(browser(), url); 278 ui_test_utils::NavigateToURL(browser(), url);
279 279
280 ASSERT_TRUE(catcher.GetNextResult()) << message_; 280 ASSERT_TRUE(catcher.GetNextResult()) << message_;
281 281
282 // Selected path should have been created by the test extension after the 282 // Selected path should have been created by the test extension after the
283 // extension function call. 283 // extension function call.
284 ASSERT_TRUE(file_util::PathExists(selected_path)); 284 ASSERT_TRUE(base::PathExists(selected_path));
285 285
286 // Let's check that the file has the expected content. 286 // Let's check that the file has the expected content.
287 const std::string expected_contents = "hello from test extension."; 287 const std::string expected_contents = "hello from test extension.";
288 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, 288 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE,
289 base::Bind(&ExpectFileContentEquals, selected_path, expected_contents)); 289 base::Bind(&ExpectFileContentEquals, selected_path, expected_contents));
290 290
291 // Make sure test doesn't finish until we check on file thread that the 291 // Make sure test doesn't finish until we check on file thread that the
292 // selected file's content is as expected. 292 // selected file's content is as expected.
293 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); 293 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
294 294
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 select_file_function.get(), 366 select_file_function.get(),
367 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]", 367 "[{\"suggestedName\": \"/path_to_file/some_file_name.txt\"}]",
368 browser()))); 368 browser())));
369 369
370 EXPECT_FALSE(utils::GetBoolean(result.get(), "success")); 370 EXPECT_FALSE(utils::GetBoolean(result.get(), "success"));
371 DictionaryValue* entry_info; 371 DictionaryValue* entry_info;
372 EXPECT_FALSE(result->GetDictionary("entry", &entry_info)); 372 EXPECT_FALSE(result->GetDictionary("entry", &entry_info));
373 } 373 }
374 374
375 } // namespace 375 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698