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 "base/file_path.h" | |
| 6 #include "base/time.h" | |
| 7 #include "chrome/browser/ui/browser.h" | |
| 8 #include "chrome/browser/ui/browser_window.h" | |
| 9 // #include "chrome/browser/ui/webui/chrome_web_ui.h" | |
|
flackr
2011/09/09 15:11:04
This will be uncommented before submission. I am w
| |
| 10 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | |
| 11 #include "chrome/browser/certificate_viewer.h" | |
| 12 #include "chrome/common/url_constants.h" | |
| 13 #include "chrome/test/base/ui_test_utils.h" | |
| 14 #include "net/base/test_certificate_data.h" | |
| 15 #include "net/base/x509_certificate.h" | |
| 16 #include <iostream> | |
|
Paweł Hajdan Jr.
2011/09/09 22:13:55
Do not #include <iostream>. This results in some s
flackr
2011/09/15 18:41:52
Oops, was using some cerr statements to help debug
| |
| 17 | |
| 18 class CertificateViewerUITest : public WebUIBrowserTest { | |
| 19 public: | |
| 20 virtual ~CertificateViewerUITest() {} | |
| 21 | |
| 22 virtual void SetUpOnMainThread() { | |
| 23 // Need to enable more WebUI when runtime flag is in use. | |
| 24 // ChromeWebUI::SetMoreWebUI(true); | |
|
flackr
2011/09/09 15:11:04
This will be uncommented before submission. I am w
| |
| 25 | |
| 26 scoped_refptr<net::X509Certificate> google_cert( | |
| 27 net::X509Certificate::CreateFromBytes( | |
| 28 reinterpret_cast<const char*>(google_der), sizeof(google_der))); | |
| 29 | |
| 30 DCHECK(browser()); | |
| 31 DCHECK(browser()->window()); | |
| 32 | |
| 33 ObserveNextHtmlDialog(); | |
| 34 ShowCertificateViewer(browser()->window()->GetNativeHandle(), google_cert); | |
| 35 WaitForHtmlDialogLoad(); | |
| 36 AddLibrary(FilePath(FILE_PATH_LITERAL( | |
| 37 "certificate_viewer_dialog_test.js"))); | |
| 38 WebUIBrowserTest::SetUpOnMainThread(); | |
| 39 | |
| 40 } | |
| 41 }; | |
| 42 | |
| 43 WEB_UI_UNITTEST_F1(CertificateViewerUITest, testDialogURL, new StringValue( | |
| 44 chrome::kChromeUICertificateViewerURL)); | |
| 45 WEB_UI_UNITTEST_F(CertificateViewerUITest, testCN); | |
| 46 WEB_UI_ASYNC_UNITTEST_F(CertificateViewerUITest, testDetails); | |
| OLD | NEW |