blob: e77132d127b7010006c56d2ce14492df509e53d3 [file] [log] [blame]
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/native_window_tracker/native_window_tracker.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
typedef InProcessBrowserTest NativeWindowTrackerTest;
IN_PROC_BROWSER_TEST_F(NativeWindowTrackerTest, Basic) {
// Create a second browser to prevent the app from exiting when the browser is
// closed.
CreateBrowser(browser()->profile());
std::unique_ptr<ui::NativeWindowTracker> tracker =
ui::NativeWindowTracker::Create(browser()->window()->GetNativeWindow());
EXPECT_FALSE(tracker->WasNativeWindowDestroyed());
browser()->window()->Close();
content::RunAllPendingInMessageLoop();
EXPECT_TRUE(tracker->WasNativeWindowDestroyed());
}