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

Side by Side Diff: mojo/runner/native_runner_unittest.cc

Issue 1130353005: Makes content handlers see requestor url (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 5 years, 7 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
« no previous file with comments | « mojo/runner/context.cc ('k') | mojo/shell/application_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "mojo/runner/context.h" 6 #include "mojo/runner/context.h"
7 #include "mojo/shell/application_manager.h" 7 #include "mojo/shell/application_manager.h"
8 #include "mojo/util/filename_util.h" 8 #include "mojo/util/filename_util.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 protected: 73 protected:
74 Context context_; 74 Context context_;
75 base::MessageLoop loop_; 75 base::MessageLoop loop_;
76 shell::ApplicationManager application_manager_; 76 shell::ApplicationManager application_manager_;
77 TestState state_; 77 TestState state_;
78 78
79 private: 79 private:
80 // shell::ApplicationManager::Delegate 80 // shell::ApplicationManager::Delegate
81 GURL ResolveMappings(const GURL& url) override { return url; } 81 GURL ResolveMappings(const GURL& url) override { return url; }
82 GURL ResolveMojoURL(const GURL& url) override { return url; } 82 GURL ResolveMojoURL(const GURL& url) override { return url; }
83 bool CreateFetcher(
84 const GURL& url,
85 const shell::Fetcher::FetchCallback& loader_callback) override {
86 return false;
87 }
83 }; 88 };
84 89
85 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { 90 TEST_F(NativeApplicationLoaderTest, DoesNotExist) {
86 base::ScopedTempDir temp_dir; 91 base::ScopedTempDir temp_dir;
87 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 92 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
88 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); 93 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt"));
89 GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); 94 GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file)));
90 InterfaceRequest<ServiceProvider> services; 95 InterfaceRequest<ServiceProvider> services;
91 ServiceProviderPtr service_provider; 96 ServiceProviderPtr service_provider;
92 application_manager_.ConnectToApplication( 97 application_manager_.ConnectToApplication(
93 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); 98 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure());
94 EXPECT_FALSE(state_.runner_was_created); 99 EXPECT_FALSE(state_.runner_was_created);
95 EXPECT_FALSE(state_.runner_was_started); 100 EXPECT_FALSE(state_.runner_was_started);
96 EXPECT_FALSE(state_.runner_was_destroyed); 101 EXPECT_FALSE(state_.runner_was_destroyed);
97 } 102 }
98 103
99 } // namespace 104 } // namespace
100 } // namespace runner 105 } // namespace runner
101 } // namespace mojo 106 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/context.cc ('k') | mojo/shell/application_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698