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

Side by Side Diff: chrome/browser/chromeos/options/wifi_config_view_browsertest.cc

Issue 5094002: Fix favorite and auto_connect property usage (again) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browsertest. Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/options/wifi_config_view.h" 5 #include "chrome/browser/chromeos/options/wifi_config_view.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" 9 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
10 #include "chrome/browser/chromeos/cros/mock_network_library.h" 10 #include "chrome/browser/chromeos/cros/mock_network_library.h"
(...skipping 23 matching lines...) Expand all
34 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(0); 34 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(0);
35 scoped_ptr<WifiNetwork> network(new WifiNetwork()); 35 scoped_ptr<WifiNetwork> network(new WifiNetwork());
36 WifiConfigView* view = new WifiConfigView(NULL, network.get()); 36 WifiConfigView* view = new WifiConfigView(NULL, network.get());
37 view->Save(); 37 view->Save();
38 } 38 }
39 39
40 // Test that if autoconnect was changed, we call SaveWifiNetwork. 40 // Test that if autoconnect was changed, we call SaveWifiNetwork.
41 IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangeAutoConnectSaveTest) { 41 IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangeAutoConnectSaveTest) {
42 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1); 42 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1);
43 scoped_ptr<WifiNetwork> remembered_network(new WifiNetwork()); 43 scoped_ptr<WifiNetwork> remembered_network(new WifiNetwork());
44 remembered_network->set_favorite(true); 44 remembered_network->favorite_ = true;
45 WifiConfigView* view = new WifiConfigView(NULL, remembered_network.get()); 45 WifiConfigView* view = new WifiConfigView(NULL, remembered_network.get());
46 ASSERT_TRUE(view->autoconnect_checkbox_ != NULL); 46 ASSERT_TRUE(view->autoconnect_checkbox_ != NULL);
47 view->autoconnect_checkbox_->SetChecked( 47 view->autoconnect_checkbox_->SetChecked(
48 !view->autoconnect_checkbox_->checked()); 48 !view->autoconnect_checkbox_->checked());
49 view->Save(); 49 view->Save();
50 } 50 }
51 51
52 // Test that if password was changed, we call SaveWifiNetwork. 52 // Test that if password was changed, we call SaveWifiNetwork.
53 IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangePasswordSaveTest) { 53 IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangePasswordSaveTest) {
54 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1); 54 EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1);
55 scoped_ptr<WifiNetwork> wifi(new WifiNetwork()); 55 scoped_ptr<WifiNetwork> wifi(new WifiNetwork());
56 wifi->set_encryption(SECURITY_WEP); 56 wifi->set_encryption(SECURITY_WEP);
57 WifiConfigView* view = new WifiConfigView(NULL, wifi.get()); 57 WifiConfigView* view = new WifiConfigView(NULL, wifi.get());
58 view->passphrase_textfield_->SetText(ASCIIToUTF16("test")); 58 view->passphrase_textfield_->SetText(ASCIIToUTF16("test"));
59 view->Save(); 59 view->Save();
60 } 60 }
61 61
62 } // namespace chromeos 62 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dom_ui/network_menu_ui.cc ('k') | chrome/browser/chromeos/status/network_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698