Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/browser.h" | |
| 6 #include "chrome/browser/ui/browser_window.h" | |
| 7 // #include "chrome/browser/ui/webui/chrome_web_ui.h" | |
| 8 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | |
| 9 #include "chrome/browser/certificate_viewer.h" | |
| 10 #include "chrome/common/url_constants.h" | |
| 11 #include "chrome/test/base/ui_test_utils.h" | |
| 12 #include "chrome/test/test_html_dialog_observer.h" | |
| 13 #include "content/browser/renderer_host/render_view_host.h" | |
| 14 #include "content/browser/tab_contents/tab_contents.h" | |
| 15 #include "content/browser/webui/web_ui.h" | |
| 16 #include "net/base/test_certificate_data.h" | |
| 17 #include "net/base/x509_certificate.h" | |
| 18 | |
| 19 // Test framework for chrome/test/data/webui/certificate_viewer_dialog_test.js. | |
| 20 class CertificateViewerUITest : public WebUIBrowserTest { | |
| 21 public: | |
| 22 virtual ~CertificateViewerUITest() {} | |
| 23 | |
| 24 virtual void SetUpOnMainThread() { | |
| 25 // Need to enable more WebUI when runtime flag is in use. | |
| 26 // ChromeWebUI::SetMoreWebUI(true); | |
| 27 | |
| 28 scoped_refptr<net::X509Certificate> google_cert( | |
| 29 net::X509Certificate::CreateFromBytes( | |
| 30 reinterpret_cast<const char*>(google_der), sizeof(google_der))); | |
| 31 | |
| 32 DCHECK(browser()); | |
|
Sheridan Rawlins
2011/09/15 19:11:41
If these are tests, they should be ASSERT_TRUE; no
flackr
2011/09/15 21:02:36
Done.
| |
| 33 DCHECK(browser()->window()); | |
| 34 | |
| 35 TestHtmlDialogObserver dialog_observer; | |
| 36 ShowCertificateViewer(browser()->window()->GetNativeHandle(), google_cert); | |
| 37 WebUI* webui = dialog_observer.GetWebUI(); | |
| 38 webui->tab_contents()->render_view_host()->SetWebUIProperty( | |
| 39 "expectedUrl", chrome::kChromeUICertificateViewerURL); | |
| 40 SetWebUIInstance(webui); | |
| 41 WebUIBrowserTest::SetUpOnMainThread(); | |
| 42 } | |
| 43 }; | |
| OLD | NEW |