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

Side by Side Diff: chrome/browser/extensions/extension_tabs_test.cc

Issue 9428018: Create BaseWindow and ExtensionWindowWrapper for extension API access to Panels (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // Invalid window ID error. 37 // Invalid window ID error.
38 EXPECT_TRUE(MatchPattern( 38 EXPECT_TRUE(MatchPattern(
39 RunFunctionAndReturnError( 39 RunFunctionAndReturnError(
40 new GetWindowFunction(), 40 new GetWindowFunction(),
41 base::StringPrintf("[%u]", window_id + 1), 41 base::StringPrintf("[%u]", window_id + 1),
42 browser()), 42 browser()),
43 keys::kWindowNotFoundError)); 43 keys::kWindowNotFoundError));
44 44
45 // Basic window details. 45 // Basic window details.
46 // Need GetRestoredBound instead of GetBounds. 46 gfx::Rect bounds;
47 // See crbug.com/98759. 47 if (browser()->window()->IsMinimized())
48 gfx::Rect bounds = browser()->window()->GetRestoredBounds(); 48 bounds = browser()->window()->GetRestoredBounds();
49 else
50 bounds = browser()->window()->GetBounds();
49 51
50 scoped_ptr<base::DictionaryValue> result(ToDictionary( 52 scoped_ptr<base::DictionaryValue> result(ToDictionary(
51 RunFunctionAndReturnResult( 53 RunFunctionAndReturnResult(
52 new GetWindowFunction(), 54 new GetWindowFunction(),
53 base::StringPrintf("[%u]", window_id), 55 base::StringPrintf("[%u]", window_id),
54 browser()))); 56 browser())));
55 EXPECT_EQ(window_id, GetInteger(result.get(), "id")); 57 EXPECT_EQ(window_id, GetInteger(result.get(), "id"));
56 EXPECT_FALSE(GetBoolean(result.get(), "incognito")); 58 EXPECT_FALSE(GetBoolean(result.get(), "incognito"));
57 EXPECT_EQ("normal", GetString(result.get(), "type")); 59 EXPECT_EQ("normal", GetString(result.get(), "type"));
58 EXPECT_EQ(bounds.x(), GetInteger(result.get(), "left")); 60 EXPECT_EQ(bounds.x(), GetInteger(result.get(), "left"));
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 442
441 static const char kArgsMaximizedWithBounds[] = 443 static const char kArgsMaximizedWithBounds[] =
442 "[%u, {\"state\": \"maximized\", \"width\": 500}]"; 444 "[%u, {\"state\": \"maximized\", \"width\": 500}]";
443 EXPECT_TRUE(MatchPattern( 445 EXPECT_TRUE(MatchPattern(
444 RunFunctionAndReturnError( 446 RunFunctionAndReturnError(
445 new UpdateWindowFunction(), 447 new UpdateWindowFunction(),
446 base::StringPrintf(kArgsMaximizedWithBounds, window_id), 448 base::StringPrintf(kArgsMaximizedWithBounds, window_id),
447 browser()), 449 browser()),
448 keys::kInvalidWindowStateError)); 450 keys::kInvalidWindowStateError));
449 } 451 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/extensions/extension_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698