| 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/time/time.h" | 5 #include "base/time/time.h" |
| 6 #include "chrome/common/render_messages.h" | 6 #include "chrome/common/render_messages.h" |
| 7 #include "chrome/renderer/translate/translate_helper.h" | 7 #include "chrome/renderer/translate/translate_helper.h" |
| 8 #include "chrome/test/base/chrome_render_view_test.h" | 8 #include "chrome/test/base/chrome_render_view_test.h" |
| 9 #include "components/translate/common/translate_constants.h" | 9 #include "components/translate/core/common/translate_constants.h" |
| 10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 13 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 14 | 14 |
| 15 using testing::AtLeast; | 15 using testing::AtLeast; |
| 16 using testing::Return; | 16 using testing::Return; |
| 17 using testing::_; | 17 using testing::_; |
| 18 | 18 |
| 19 class TestTranslateHelper : public TranslateHelper { | 19 class TestTranslateHelper : public TranslateHelper { |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 GoBack(GetMainFrame()->previousHistoryItem()); | 473 GoBack(GetMainFrame()->previousHistoryItem()); |
| 474 | 474 |
| 475 message = render_thread_->sink().GetUniqueMessageMatching( | 475 message = render_thread_->sink().GetUniqueMessageMatching( |
| 476 ChromeViewHostMsg_TranslateLanguageDetermined::ID); | 476 ChromeViewHostMsg_TranslateLanguageDetermined::ID); |
| 477 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 477 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 478 ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); | 478 ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); |
| 479 EXPECT_EQ("zh", params.a.adopted_language); | 479 EXPECT_EQ("zh", params.a.adopted_language); |
| 480 render_thread_->sink().ClearMessages(); | 480 render_thread_->sink().ClearMessages(); |
| 481 } | 481 } |
| OLD | NEW |