| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 22 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 22 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 25 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
| 26 #include "chrome/test/base/testing_browser_process.h" | 26 #include "chrome/test/base/testing_browser_process.h" |
| 27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
| 28 #include "content/browser/renderer_host/mock_render_process_host.h" | 28 #include "content/browser/renderer_host/mock_render_process_host.h" |
| 29 #include "content/browser/tab_contents/navigation_details.h" | 29 #include "content/browser/tab_contents/navigation_details.h" |
| 30 #include "content/browser/tab_contents/test_tab_contents.h" | 30 #include "content/browser/tab_contents/test_tab_contents.h" |
| 31 #include "content/common/view_messages.h" | |
| 32 #include "content/public/browser/notification_details.h" | 31 #include "content/public/browser/notification_details.h" |
| 33 #include "content/public/browser/notification_registrar.h" | 32 #include "content/public/browser/notification_registrar.h" |
| 34 #include "content/test/notification_observer_mock.h" | 33 #include "content/test/notification_observer_mock.h" |
| 35 #include "content/test/test_browser_thread.h" | 34 #include "content/test/test_browser_thread.h" |
| 36 #include "content/test/test_url_fetcher_factory.h" | 35 #include "content/test/test_url_fetcher_factory.h" |
| 37 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 38 #include "ipc/ipc_test_sink.h" | 37 #include "ipc/ipc_test_sink.h" |
| 39 #include "testing/gmock/include/gmock/gmock.h" | 38 #include "testing/gmock/include/gmock/gmock.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
| 41 #include "third_party/cld/languages/public/languages.h" | 40 #include "third_party/cld/languages/public/languages.h" |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 NULL); | 1339 NULL); |
| 1341 // Now simulate the URL fetch. | 1340 // Now simulate the URL fetch. |
| 1342 SimulateTranslateScriptURLFetch(true); | 1341 SimulateTranslateScriptURLFetch(true); |
| 1343 // Now the message should have been sent. | 1342 // Now the message should have been sent. |
| 1344 int page_id = 0; | 1343 int page_id = 0; |
| 1345 std::string original_lang, target_lang; | 1344 std::string original_lang, target_lang; |
| 1346 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); | 1345 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); |
| 1347 EXPECT_EQ("es", original_lang); | 1346 EXPECT_EQ("es", original_lang); |
| 1348 EXPECT_EQ("en", target_lang); | 1347 EXPECT_EQ("en", target_lang); |
| 1349 } | 1348 } |
| OLD | NEW |