| 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 <tuple> | 5 #include <tuple> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/common/chrome_isolated_world_ids.h" | 9 #include "chrome/common/chrome_isolated_world_ids.h" |
| 10 #include "chrome/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 | 457 |
| 458 LoadHTML("<html><head><meta http-equiv=\"content-language\" content=\"fr\">" | 458 LoadHTML("<html><head><meta http-equiv=\"content-language\" content=\"fr\">" |
| 459 "</head><body>This page is in French.</body></html>"); | 459 "</head><body>This page is in French.</body></html>"); |
| 460 message = render_thread_->sink().GetUniqueMessageMatching( | 460 message = render_thread_->sink().GetUniqueMessageMatching( |
| 461 ChromeFrameHostMsg_TranslateLanguageDetermined::ID); | 461 ChromeFrameHostMsg_TranslateLanguageDetermined::ID); |
| 462 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 462 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 463 ChromeFrameHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); | 463 ChromeFrameHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); |
| 464 EXPECT_EQ("fr", std::get<0>(params).adopted_language); | 464 EXPECT_EQ("fr", std::get<0>(params).adopted_language); |
| 465 render_thread_->sink().ClearMessages(); | 465 render_thread_->sink().ClearMessages(); |
| 466 | 466 |
| 467 GoBack(back_state); | 467 GoBack(GURL("data:text/html;charset=utf-8,<html><head>" |
| 468 "<meta http-equiv=\"content-language\" content=\"zh\">" |
| 469 "</head><body>This page is in Chinese.</body></html>"), |
| 470 back_state); |
| 468 | 471 |
| 469 message = render_thread_->sink().GetUniqueMessageMatching( | 472 message = render_thread_->sink().GetUniqueMessageMatching( |
| 470 ChromeFrameHostMsg_TranslateLanguageDetermined::ID); | 473 ChromeFrameHostMsg_TranslateLanguageDetermined::ID); |
| 471 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); | 474 ASSERT_NE(static_cast<IPC::Message*>(NULL), message); |
| 472 ChromeFrameHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); | 475 ChromeFrameHostMsg_TranslateLanguageDetermined::Read(message, ¶ms); |
| 473 EXPECT_EQ("zh", std::get<0>(params).adopted_language); | 476 EXPECT_EQ("zh", std::get<0>(params).adopted_language); |
| 474 render_thread_->sink().ClearMessages(); | 477 render_thread_->sink().ClearMessages(); |
| 475 } | 478 } |
| OLD | NEW |