OLD | NEW |
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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 using ::testing::WithArg; | 55 using ::testing::WithArg; |
56 using ::testing::_; | 56 using ::testing::_; |
57 using content::DownloadItem; | 57 using content::DownloadItem; |
58 | 58 |
59 namespace { | 59 namespace { |
60 | 60 |
61 // No-op delegate. | 61 // No-op delegate. |
62 class NullWebContentsDelegate : public content::WebContentsDelegate { | 62 class NullWebContentsDelegate : public content::WebContentsDelegate { |
63 public: | 63 public: |
64 NullWebContentsDelegate() {} | 64 NullWebContentsDelegate() {} |
65 virtual ~NullWebContentsDelegate() {} | 65 ~NullWebContentsDelegate() override {} |
66 }; | 66 }; |
67 | 67 |
68 // Google Mock action that posts a task to the current message loop that invokes | 68 // Google Mock action that posts a task to the current message loop that invokes |
69 // the first argument of the mocked method as a callback. Said argument must be | 69 // the first argument of the mocked method as a callback. Said argument must be |
70 // a base::Callback<void(ParamType)>. |result| must be of |ParamType| and is | 70 // a base::Callback<void(ParamType)>. |result| must be of |ParamType| and is |
71 // bound as that parameter. | 71 // bound as that parameter. |
72 // Example: | 72 // Example: |
73 // class FooClass { | 73 // class FooClass { |
74 // public: | 74 // public: |
75 // virtual void Foo(base::Callback<void(bool)> callback); | 75 // virtual void Foo(base::Callback<void(bool)> callback); |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) | 2182 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) |
2183 .WillRepeatedly(Return(true)); | 2183 .WillRepeatedly(Return(true)); |
2184 | 2184 |
2185 target_info = RunDownloadTargetDeterminer( | 2185 target_info = RunDownloadTargetDeterminer( |
2186 GetPathInDownloadDir(kInitialPath), item.get()); | 2186 GetPathInDownloadDir(kInitialPath), item.get()); |
2187 EXPECT_FALSE(target_info->is_filetype_handled_safely); | 2187 EXPECT_FALSE(target_info->is_filetype_handled_safely); |
2188 } | 2188 } |
2189 #endif // defined(ENABLE_PLUGINS) | 2189 #endif // defined(ENABLE_PLUGINS) |
2190 | 2190 |
2191 } // namespace | 2191 } // namespace |
OLD | NEW |