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

Side by Side Diff: chrome/browser/translate/translate_manager_browsertest.cc

Issue 10494012: Move mock notification observer header from content\test to content\public\test. This way we can en… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 5
6 #include <algorithm> 6 #include <algorithm>
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 16 matching lines...) Expand all
27 #include "chrome/common/chrome_notification_types.h" 27 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
29 #include "chrome/common/render_messages.h" 29 #include "chrome/common/render_messages.h"
30 #include "chrome/test/base/testing_browser_process.h" 30 #include "chrome/test/base/testing_browser_process.h"
31 #include "chrome/test/base/testing_profile.h" 31 #include "chrome/test/base/testing_profile.h"
32 #include "content/public/browser/navigation_details.h" 32 #include "content/public/browser/navigation_details.h"
33 #include "content/public/browser/navigation_entry.h" 33 #include "content/public/browser/navigation_entry.h"
34 #include "content/public/browser/notification_details.h" 34 #include "content/public/browser/notification_details.h"
35 #include "content/public/browser/notification_registrar.h" 35 #include "content/public/browser/notification_registrar.h"
36 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
37 #include "content/public/test/mock_notification_observer.h"
37 #include "content/test/mock_render_process_host.h" 38 #include "content/test/mock_render_process_host.h"
38 #include "content/test/notification_observer_mock.h"
39 #include "content/test/render_view_test.h" 39 #include "content/test/render_view_test.h"
40 #include "content/test/test_browser_thread.h" 40 #include "content/test/test_browser_thread.h"
41 #include "content/test/test_renderer_host.h" 41 #include "content/test/test_renderer_host.h"
42 #include "content/test/test_renderer_host.h" 42 #include "content/test/test_renderer_host.h"
43 #include "content/test/test_url_fetcher_factory.h" 43 #include "content/test/test_url_fetcher_factory.h"
44 #include "grit/generated_resources.h" 44 #include "grit/generated_resources.h"
45 #include "ipc/ipc_test_sink.h" 45 #include "ipc/ipc_test_sink.h"
46 #include "testing/gmock/include/gmock/gmock.h" 46 #include "testing/gmock/include/gmock/gmock.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 void SetPrefObserverExpectation(const char* path) { 244 void SetPrefObserverExpectation(const char* path) {
245 EXPECT_CALL( 245 EXPECT_CALL(
246 pref_observer_, 246 pref_observer_,
247 Observe(int(chrome::NOTIFICATION_PREF_CHANGED), 247 Observe(int(chrome::NOTIFICATION_PREF_CHANGED),
248 _, 248 _,
249 Property(&content::Details<std::string>::ptr, Pointee(path)))); 249 Property(&content::Details<std::string>::ptr, Pointee(path))));
250 } 250 }
251 251
252 content::NotificationObserverMock pref_observer_; 252 content::MockNotificationObserver pref_observer_;
253 253
254 private: 254 private:
255 content::NotificationRegistrar notification_registrar_; 255 content::NotificationRegistrar notification_registrar_;
256 TestURLFetcherFactory url_fetcher_factory_; 256 TestURLFetcherFactory url_fetcher_factory_;
257 content::TestBrowserThread ui_thread_; 257 content::TestBrowserThread ui_thread_;
258 content::RenderViewTest::RendererWebKitPlatformSupportImplNoSandbox 258 content::RenderViewTest::RendererWebKitPlatformSupportImplNoSandbox
259 webkit_platform_support_; 259 webkit_platform_support_;
260 260
261 // The infobars that have been removed. 261 // The infobars that have been removed.
262 // WARNING: the pointers point to deleted objects, use only for comparison. 262 // WARNING: the pointers point to deleted objects, use only for comparison.
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 NULL); 1460 NULL);
1461 // Now simulate the URL fetch. 1461 // Now simulate the URL fetch.
1462 SimulateTranslateScriptURLFetch(true); 1462 SimulateTranslateScriptURLFetch(true);
1463 // Now the message should have been sent. 1463 // Now the message should have been sent.
1464 int page_id = 0; 1464 int page_id = 0;
1465 std::string original_lang, target_lang; 1465 std::string original_lang, target_lang;
1466 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); 1466 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang));
1467 EXPECT_EQ("es", original_lang); 1467 EXPECT_EQ("es", original_lang);
1468 EXPECT_EQ("en", target_lang); 1468 EXPECT_EQ("en", target_lang);
1469 } 1469 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_password_unittest.cc ('k') | chrome/browser/ui/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698