| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/chrome_constants.h" | 5 #include "chrome/common/chrome_constants.h" |
| 6 #include "chrome/common/render_messages.h" | 6 #include "chrome/common/render_messages.h" |
| 7 #include "chrome/renderer/translate_helper.h" | 7 #include "chrome/renderer/translate_helper.h" |
| 8 #include "chrome/test/render_view_test.h" | 8 #include "chrome/test/base/render_view_test.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using testing::AtLeast; | 12 using testing::AtLeast; |
| 13 using testing::Return; | 13 using testing::Return; |
| 14 | 14 |
| 15 class TestTranslateHelper : public TranslateHelper { | 15 class TestTranslateHelper : public TranslateHelper { |
| 16 public: | 16 public: |
| 17 explicit TestTranslateHelper(RenderView* render_view) | 17 explicit TestTranslateHelper(RenderView* render_view) |
| 18 : TranslateHelper(render_view, NULL) { | 18 : TranslateHelper(render_view, NULL) { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 LoadHTML("<html><head><meta http-equiv=\"content-language\" " | 355 LoadHTML("<html><head><meta http-equiv=\"content-language\" " |
| 356 "content=\" fr , es,en \">" | 356 "content=\" fr , es,en \">" |
| 357 "</head><body>A random page with random content.</body></html>"); | 357 "</head><body>A random page with random content.</body></html>"); |
| 358 ProcessPendingMessages(); | 358 ProcessPendingMessages(); |
| 359 message = render_thread_.sink().GetUniqueMessageMatching( | 359 message = render_thread_.sink().GetUniqueMessageMatching( |
| 360 ViewHostMsg_TranslateLanguageDetermined::ID); | 360 ViewHostMsg_TranslateLanguageDetermined::ID); |
| 361 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 361 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 362 ViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); | 362 ViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); |
| 363 EXPECT_EQ("fr", params.a); | 363 EXPECT_EQ("fr", params.a); |
| 364 } | 364 } |
| OLD | NEW |