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/basictypes.h" | 5 #include "base/basictypes.h" |
6 | 6 |
7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 view()->OnCandidateWindowUpdated(); | 2143 view()->OnCandidateWindowUpdated(); |
2144 view()->OnCandidateWindowHidden(); | 2144 view()->OnCandidateWindowHidden(); |
2145 | 2145 |
2146 // Retrieve the content and check if it is expected. | 2146 // Retrieve the content and check if it is expected. |
2147 const int kMaxOutputCharacters = 50; | 2147 const int kMaxOutputCharacters = 50; |
2148 std::string output = UTF16ToUTF8( | 2148 std::string output = UTF16ToUTF8( |
2149 GetMainFrame()->contentAsText(kMaxOutputCharacters)); | 2149 GetMainFrame()->contentAsText(kMaxOutputCharacters)); |
2150 EXPECT_EQ(output, "\nResult:showupdatehide"); | 2150 EXPECT_EQ(output, "\nResult:showupdatehide"); |
2151 } | 2151 } |
2152 | 2152 |
| 2153 // Ensure the render view sends favicon url update events correctly. |
| 2154 TEST_F(RenderViewImplTest, SendFaviconURLUpdateEvent) { |
| 2155 // An event should be sent when a favicon url exists. |
| 2156 LoadHTML("<html>" |
| 2157 "<head>" |
| 2158 "<link rel='icon' href='http://www.google.com/favicon.ico'>" |
| 2159 "</head>" |
| 2160 "</html>"); |
| 2161 EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching( |
| 2162 ViewHostMsg_UpdateFaviconURL::ID)); |
| 2163 render_thread_->sink().ClearMessages(); |
| 2164 |
| 2165 // An event should not be sent if no favicon url exists. This is an assumption |
| 2166 // made by some of Chrome's favicon handling. |
| 2167 LoadHTML("<html>" |
| 2168 "<head>" |
| 2169 "</head>" |
| 2170 "</html>"); |
| 2171 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
| 2172 ViewHostMsg_UpdateFaviconURL::ID)); |
| 2173 } |
| 2174 |
2153 } // namespace content | 2175 } // namespace content |
OLD | NEW |