blob: b377c730ac5ceb06a737af245cc7bf29ccfd919d [file] [log] [blame]
Tibor Goldschwendtf9b5acd2017-09-29 13:59:031// Copyright 2017 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/strings/utf_string_conversions.h"
Bill Orr05fb10e2017-10-14 08:32:546#include "build/build_config.h"
Tommy C. Li1a266642018-10-30 18:58:377#include "chrome/browser/vr/model/location_bar_state.h"
Tibor Goldschwendtf9b5acd2017-09-29 13:59:038#include "chrome/browser/vr/test/constants.h"
9#include "chrome/browser/vr/test/ui_pixel_test.h"
Tommy C. Li3dac9042018-10-29 17:52:3410#include "components/omnibox/browser/vector_icons.h"
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0311#include "testing/gtest/include/gtest/gtest.h"
12
13namespace vr {
14
15namespace {
16
Aldo Culquicondor9152d532018-09-25 14:55:1417constexpr gfx::Transform kIdentity;
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0318
19} // namespace
20
Alex Cooper29432cf2020-01-09 01:12:0621TEST_F(UiPixelTest, DrawVrBrowsingMode) {
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0322 // Set up scene.
23 UiInitialState ui_initial_state;
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0324 ui_initial_state.in_web_vr = false;
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0325 MakeUi(ui_initial_state,
Tommy C. Li1a266642018-10-30 18:58:3726 LocationBarState(GURL("https://example.com"), security_state::SECURE,
27 &omnibox::kHttpsValidIcon, true, false));
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0328
29 // Draw UI.
30 DrawUi(gfx::Vector3dF(0.0f, 0.0f, -1.0f), gfx::Point3F(0.5f, -0.5f, 0.0f),
Aldo Culquicondor6cd1c822018-08-16 20:27:1131 ControllerModel::ButtonState::kUp, 1.0f, kIdentity, kIdentity,
Aldo Culquicondorcc004c72018-08-02 14:50:0232 GetPixelDaydreamProjMatrix());
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0333
34 // Read pixels into SkBitmap.
35 auto bitmap = SaveCurrentFrameBufferToSkBitmap();
36 EXPECT_TRUE(bitmap);
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0337}
38
39} // namespace vr