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

Unified Diff: chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc

Issue 11747025: Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ms release build Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
diff --git a/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc b/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
index 56891008874383dc861e8da7ba638927aef08bea..c605ab70f9bec55df2ea18e6c7ab19ebaca28a2e 100644
--- a/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
@@ -64,7 +64,7 @@ void ExpectFileContentEquals(const FilePath& selected_path,
EXPECT_EQ(expected_contents, test_file_contents);
}
-// Mocks FileSelector used by FileHandlerSelectFileFunction.
+// Mocks FileSelector used by FileBrowserHandlerInternalSelectFileFunction.
// When |SelectFile| is called, it will check that file name suggestion is as
// expected, and respond to the extension function with specified selection
// results.
@@ -83,10 +83,11 @@ class MockFileSelector : public file_handler::FileSelector {
// file_handler::FileSelector implementation.
// |browser| is not used.
- virtual void SelectFile(const FilePath& suggested_name,
- const std::vector<std::string>& allowed_extensions,
- Browser* browser,
- FileHandlerSelectFileFunction* function) OVERRIDE {
+ virtual void SelectFile(
+ const FilePath& suggested_name,
+ const std::vector<std::string>& allowed_extensions,
+ Browser* browser,
+ FileBrowserHandlerInternalSelectFileFunction* function) OVERRIDE {
// Confirm that the function suggested us the right name.
EXPECT_EQ(suggested_name_, suggested_name);
// Confirm that the function allowed us the right extensions.
@@ -100,8 +101,9 @@ class MockFileSelector : public file_handler::FileSelector {
// Send response to the extension function.
// The callback will take a reference to the function and keep it alive.
base::MessageLoopProxy::current()->PostTask(FROM_HERE,
- base::Bind(&FileHandlerSelectFileFunction::OnFilePathSelected,
- function, success_, selected_path_));
+ base::Bind(&FileBrowserHandlerInternalSelectFileFunction::
+ OnFilePathSelected,
+ function, success_, selected_path_));
delete this;
}
@@ -182,10 +184,10 @@ class FileBrowserHandlerExtensionTest : public ExtensionApiTest {
return tmp_mount_point_.Append(relative_path);
}
- // Creates a new FileHandlerSelectFileFunction to be used in the test.
- // This function will be called from ExtensionFunctinoDispatcher whenever
- // an extension function for fileBrowserHandlerInternal.selectFile will be
- // needed.
+ // Creates a new FileBrowserHandlerInternalSelectFileFunction to be used in
+ // the test. This function will be called from ExtensionFunctinoDispatcher
+ // whenever an extension function for fileBrowserHandlerInternal.selectFile
+ // will be needed.
static ExtensionFunction* TestSelectFileFunctionFactory() {
EXPECT_TRUE(test_cases_);
EXPECT_TRUE(current_test_case_ < test_cases_->size());
@@ -193,14 +195,15 @@ class FileBrowserHandlerExtensionTest : public ExtensionApiTest {
// If this happens, test failed. But, we still don't want to crash, so
// return valid extension function.
if (!test_cases_ && current_test_case_ >= test_cases_->size())
- return new FileHandlerSelectFileFunction();
+ return new FileBrowserHandlerInternalSelectFileFunction();
// Create file creator factory for the current test case.
MockFileSelectorFactory* mock_factory =
new MockFileSelectorFactory(test_cases_->at(current_test_case_));
current_test_case_++;
- return new FileHandlerSelectFileFunction(mock_factory, false);
+ return new FileBrowserHandlerInternalSelectFileFunction(
+ mock_factory, false);
}
// Sets up test parameters for extension function invocations that will be
@@ -289,8 +292,9 @@ IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, EndToEnd) {
// Tests that verifies the fileBrowserHandlerInternal.selectFile function fails
// when invoked without user gesture.
IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, NoUserGesture) {
- scoped_refptr<FileHandlerSelectFileFunction> select_file_function(
- new FileHandlerSelectFileFunction());
+ scoped_refptr<FileBrowserHandlerInternalSelectFileFunction>
+ select_file_function(
+ new FileBrowserHandlerInternalSelectFileFunction());
std::string error =
utils::RunFunctionAndReturnError(
@@ -313,9 +317,11 @@ IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, SelectionFailed) {
false,
FilePath());
- scoped_refptr<FileHandlerSelectFileFunction> select_file_function(
- new FileHandlerSelectFileFunction(new MockFileSelectorFactory(test_case),
- false));
+ scoped_refptr<FileBrowserHandlerInternalSelectFileFunction>
+ select_file_function(
+ new FileBrowserHandlerInternalSelectFileFunction(
+ new MockFileSelectorFactory(test_case),
+ false));
select_file_function->set_has_callback(true);
select_file_function->set_user_gesture(true);
@@ -340,9 +346,11 @@ IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, SuggestedFullPath) {
false,
FilePath());
- scoped_refptr<FileHandlerSelectFileFunction> select_file_function(
- new FileHandlerSelectFileFunction(new MockFileSelectorFactory(test_case),
- false));
+ scoped_refptr<FileBrowserHandlerInternalSelectFileFunction>
+ select_file_function(
+ new FileBrowserHandlerInternalSelectFileFunction(
+ new MockFileSelectorFactory(test_case),
+ false));
select_file_function->set_has_callback(true);
select_file_function->set_user_gesture(true);
« no previous file with comments | « chrome/browser/chromeos/extensions/file_browser_handler_api.cc ('k') | chrome/browser/extensions/api/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698