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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_apitest.cc

Issue 673933002: Correctly set tab.active not tab.selected in the chrome.sessions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 2 months 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 | « chrome/browser/extensions/api/sessions/sessions_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/sessions/sessions_apitest.cc
diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
index 0e0e8998dd1008816fa927c7562fc1687d72664c..6182c14874ba01d8cd6f0c39caf202f548eb1a0d 100644
--- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
@@ -257,7 +257,15 @@ testing::AssertionResult CheckSessionModels(const base::ListValue& devices,
EXPECT_FALSE(tab->HasKey("id")); // sessions API does not give tab IDs
EXPECT_EQ(static_cast<int>(j), utils::GetInteger(tab, "index"));
EXPECT_EQ(0, utils::GetInteger(tab, "windowId"));
- EXPECT_EQ(true, utils::GetBoolean(tab, "pinned"));
+ // Test setup code always sets tab 0 to selected (which means active in
+ // extension terminology).
+ EXPECT_EQ(j == 0, utils::GetBoolean(tab, "active"));
+ // While selected/highlighted are different to active, and should always
+ // be false.
+ EXPECT_FALSE(utils::GetBoolean(tab, "selected"));
+ EXPECT_FALSE(utils::GetBoolean(tab, "highlighted"));
+ EXPECT_FALSE(utils::GetBoolean(tab, "incognito"));
+ EXPECT_TRUE(utils::GetBoolean(tab, "pinned"));
EXPECT_EQ("http://foo/1", utils::GetString(tab, "url"));
EXPECT_EQ("MyTitle", utils::GetString(tab, "title"));
EXPECT_EQ("http://foo/favicon.ico", utils::GetString(tab, "favIconUrl"));
« no previous file with comments | « chrome/browser/extensions/api/sessions/sessions_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698