blob: 958741aa36b74a2bc757764dc14cd1c4a6998084 [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
Aldo Culquicondor859f36df2018-09-26 18:46:3921TEST_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;
25 ui_initial_state.web_vr_autopresentation_expected = false;
26 MakeUi(ui_initial_state,
Tommy C. Li1a266642018-10-30 18:58:3727 LocationBarState(GURL("https://example.com"), security_state::SECURE,
28 &omnibox::kHttpsValidIcon, true, false));
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0329
30 // Draw UI.
31 DrawUi(gfx::Vector3dF(0.0f, 0.0f, -1.0f), gfx::Point3F(0.5f, -0.5f, 0.0f),
Aldo Culquicondor6cd1c822018-08-16 20:27:1132 ControllerModel::ButtonState::kUp, 1.0f, kIdentity, kIdentity,
Aldo Culquicondorcc004c72018-08-02 14:50:0233 GetPixelDaydreamProjMatrix());
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0334
35 // Read pixels into SkBitmap.
36 auto bitmap = SaveCurrentFrameBufferToSkBitmap();
37 EXPECT_TRUE(bitmap);
Tibor Goldschwendtf9b5acd2017-09-29 13:59:0338}
39
40} // namespace vr