Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1304)

Unified Diff: chrome/browser/ui/ash/networking_config_delegate_chromeos_browsertest.cc

Issue 2563943002: Revert of Add test for system tray network menu icon for extension-controlled networks (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/networking_config_delegate_chromeos_browsertest.cc
diff --git a/chrome/browser/ui/ash/networking_config_delegate_chromeos_browsertest.cc b/chrome/browser/ui/ash/networking_config_delegate_chromeos_browsertest.cc
deleted file mode 100644
index c0764f428025b1eeee26052d9c86317b8f6881e5..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/ash/networking_config_delegate_chromeos_browsertest.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h"
-
-#include "ash/common/login_status.h"
-#include "ash/common/strings/grit/ash_strings.h"
-#include "ash/common/system/chromeos/network/tray_network.h"
-#include "ash/common/system/tray/system_tray.h"
-#include "ash/common/wm_root_window_controller.h"
-#include "ash/common/wm_shell.h"
-#include "base/macros.h"
-#include "base/strings/string16.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/extensions/extension_browsertest.h"
-#include "content/public/test/test_utils.h"
-#include "extensions/test/extension_test_message_listener.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/views/view.h"
-
-namespace {
-
-// Returns true if this view or any child view has the given tooltip.
-bool HasChildWithTooltip(views::View* view,
- const base::string16& given_tooltip) {
- base::string16 tooltip;
- view->GetTooltipText(gfx::Point(), &tooltip);
- if (tooltip == given_tooltip)
- return true;
-
- for (int i = 0; i < view->child_count(); ++i) {
- if (HasChildWithTooltip(view->child_at(i), given_tooltip))
- return true;
- }
-
- return false;
-}
-
-using NetworkingConfigDelegateChromeosTest = ExtensionBrowserTest;
-
-// Tests that an extension registering itself as handling a Wi-Fi SSID updates
-// the ash system tray network item.
-IN_PROC_BROWSER_TEST_F(NetworkingConfigDelegateChromeosTest, SystemTrayItem) {
- // Load the extension and wait for the background page script to run. This
- // registers the extension as the network config handler for wifi1.
- ExtensionTestMessageListener listener("done", false);
- ASSERT_TRUE(
- LoadExtension(test_data_dir_.AppendASCII("networking_config_delegate")));
- ASSERT_TRUE(listener.WaitUntilSatisfied());
-
- // Simulate opening the networking details menu.
- ash::TrayNetwork* tray_network = ash::WmShell::Get()
- ->GetPrimaryRootWindowController()
- ->GetSystemTray()
- ->GetTrayNetworkForTesting();
- std::unique_ptr<views::View> detailed_view(
- tray_network->CreateDetailedView(ash::LoginStatus::OWNER));
-
- // Look for an item with a tooltip saying it is an extension-controlled
- // network. Searching all children allows this test to avoid knowing about the
- // specifics of the view hierarchy.
- base::string16 expected_tooltip = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI,
- base::UTF8ToUTF16("NetworkingConfigDelegate test extension"));
- EXPECT_TRUE(HasChildWithTooltip(detailed_view.get(), expected_tooltip));
-}
-
-} // namespace
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698