Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: chrome_frame/test/ui_test.cc

Issue 15950011: content: Move kViewSourceScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/navigation_constraints.cc ('k') | chrome_frame/utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <mshtmcid.h> 5 #include <mshtmcid.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/test/test_file_util.h" 9 #include "base/test/test_file_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 EXPECT_CALL(ie_mock_, OnLoad(in_cf, 315 EXPECT_CALL(ie_mock_, OnLoad(in_cf,
316 StrEq(GetSimplePageUrl()))) 316 StrEq(GetSimplePageUrl())))
317 .WillOnce(DelayExecCommand( 317 .WillOnce(DelayExecCommand(
318 &ie_mock_, &loop_, base::TimeDelta(), &CGID_MSHTML, 318 &ie_mock_, &loop_, base::TimeDelta(), &CGID_MSHTML,
319 static_cast<OLECMDID>(IDM_VIEWSOURCE), 319 static_cast<OLECMDID>(IDM_VIEWSOURCE),
320 OLECMDEXECOPT_DONTPROMPTUSER, &empty, &empty)); 320 OLECMDEXECOPT_DONTPROMPTUSER, &empty, &empty));
321 321
322 // Expect notification for view-source window, handle new window event 322 // Expect notification for view-source window, handle new window event
323 // and attach a new ie_mock_ to the received web browser 323 // and attach a new ie_mock_ to the received web browser
324 std::wstring view_source_url; 324 std::wstring view_source_url;
325 view_source_url += UTF8ToWide(chrome::kViewSourceScheme); 325 view_source_url += UTF8ToWide(content::kViewSourceScheme);
326 view_source_url += L":"; 326 view_source_url += L":";
327 view_source_url += GetSimplePageUrl(); 327 view_source_url += GetSimplePageUrl();
328 std::wstring url_in_new_window = kChromeProtocolPrefix; 328 std::wstring url_in_new_window = kChromeProtocolPrefix;
329 url_in_new_window += view_source_url; 329 url_in_new_window += view_source_url;
330 330
331 ie_mock_.ExpectNewWindow(&view_source_mock); 331 ie_mock_.ExpectNewWindow(&view_source_mock);
332 // For some reason this happens occasionally at least on XP IE7. 332 // For some reason this happens occasionally at least on XP IE7.
333 EXPECT_CALL(view_source_mock, OnLoad(IN_IE, StrEq(url_in_new_window))) 333 EXPECT_CALL(view_source_mock, OnLoad(IN_IE, StrEq(url_in_new_window)))
334 .Times(testing::AtMost(1)); 334 .Times(testing::AtMost(1));
335 EXPECT_CALL(view_source_mock, OnLoad(in_cf, StrEq(view_source_url))) 335 EXPECT_CALL(view_source_mock, OnLoad(in_cf, StrEq(view_source_url)))
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // View the page source. 558 // View the page source.
559 EXPECT_CALL(acc_observer_, 559 EXPECT_CALL(acc_observer_,
560 OnAccDocLoad(TabContentsTitleEq(GetSimplePageTitle()))) 560 OnAccDocLoad(TabContentsTitleEq(GetSimplePageTitle())))
561 .WillOnce(OpenContextMenuAsync()); 561 .WillOnce(OpenContextMenuAsync());
562 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) 562 EXPECT_CALL(acc_observer_, OnMenuPopup(_))
563 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page source"))); 563 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page source")));
564 564
565 // Expect notification for view-source window, handle new window event 565 // Expect notification for view-source window, handle new window event
566 // and attach a new ie_mock_ to the received web browser 566 // and attach a new ie_mock_ to the received web browser
567 std::wstring view_source_url; 567 std::wstring view_source_url;
568 view_source_url += UTF8ToWide(chrome::kViewSourceScheme); 568 view_source_url += UTF8ToWide(content::kViewSourceScheme);
569 view_source_url += L":"; 569 view_source_url += L":";
570 view_source_url += GetSimplePageUrl(); 570 view_source_url += GetSimplePageUrl();
571 std::wstring url_in_new_window = kChromeProtocolPrefix; 571 std::wstring url_in_new_window = kChromeProtocolPrefix;
572 url_in_new_window += view_source_url; 572 url_in_new_window += view_source_url;
573 573
574 ie_mock_.ExpectNewWindow(&view_source_mock); 574 ie_mock_.ExpectNewWindow(&view_source_mock);
575 // For some reason this happens occasionally at least on XP IE7 and Win7 IE8. 575 // For some reason this happens occasionally at least on XP IE7 and Win7 IE8.
576 EXPECT_CALL(view_source_mock, OnLoad(IN_IE, StrEq(url_in_new_window))) 576 EXPECT_CALL(view_source_mock, OnLoad(IN_IE, StrEq(url_in_new_window)))
577 .Times(testing::AtMost(1)); 577 .Times(testing::AtMost(1));
578 EXPECT_CALL(view_source_mock, OnLoad(IN_CF, StrEq(view_source_url))) 578 EXPECT_CALL(view_source_mock, OnLoad(IN_CF, StrEq(view_source_url)))
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) 1080 EXPECT_CALL(acc_observer_, OnMenuPopup(_))
1081 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward"))); 1081 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward")));
1082 1082
1083 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3))) 1083 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3)))
1084 .WillOnce(CloseBrowserMock(&ie_mock_)); 1084 .WillOnce(CloseBrowserMock(&ie_mock_));
1085 1085
1086 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); 1086 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout);
1087 } 1087 }
1088 1088
1089 } // namespace chrome_frame_test 1089 } // namespace chrome_frame_test
OLDNEW
« no previous file with comments | « chrome_frame/navigation_constraints.cc ('k') | chrome_frame/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698