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

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: Address comments. Created 8 years, 10 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 RunFunctionAndReturnError( 379 RunFunctionAndReturnError(
380 new CreateWindowFunction(), 380 new CreateWindowFunction(),
381 kArgs, 381 kArgs,
382 incognito_browser), 382 incognito_browser),
383 keys::kIncognitoModeIsDisabled)); 383 keys::kIncognitoModeIsDisabled));
384 } 384 }
385 385
386 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) { 386 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) {
387 int window_id = ExtensionTabUtil::GetWindowId(browser()); 387 int window_id = ExtensionTabUtil::GetWindowId(browser());
388 388
389 #if !defined(USE_AURA)
390 // Disabled for now (crbug.com/105173) because window minimization is not
391 // supported on Aura yet (crbug.com/104571).
392 static const char kArgsMinimizedWithFocus[] = 389 static const char kArgsMinimizedWithFocus[] =
393 "[%u, {\"state\": \"minimized\", \"focused\": true}]"; 390 "[%u, {\"state\": \"minimized\", \"focused\": true}]";
394 EXPECT_TRUE(MatchPattern( 391 EXPECT_TRUE(MatchPattern(
395 RunFunctionAndReturnError( 392 RunFunctionAndReturnError(
396 new UpdateWindowFunction(), 393 new UpdateWindowFunction(),
397 base::StringPrintf(kArgsMinimizedWithFocus, window_id), 394 base::StringPrintf(kArgsMinimizedWithFocus, window_id),
398 browser()), 395 browser()),
399 keys::kInvalidWindowStateError)); 396 keys::kInvalidWindowStateError));
400 #endif
401 397
402 static const char kArgsMaximizedWithoutFocus[] = 398 static const char kArgsMaximizedWithoutFocus[] =
403 "[%u, {\"state\": \"maximized\", \"focused\": false}]"; 399 "[%u, {\"state\": \"maximized\", \"focused\": false}]";
404 EXPECT_TRUE(MatchPattern( 400 EXPECT_TRUE(MatchPattern(
405 RunFunctionAndReturnError( 401 RunFunctionAndReturnError(
406 new UpdateWindowFunction(), 402 new UpdateWindowFunction(),
407 base::StringPrintf(kArgsMaximizedWithoutFocus, window_id), 403 base::StringPrintf(kArgsMaximizedWithoutFocus, window_id),
408 browser()), 404 browser()),
409 keys::kInvalidWindowStateError)); 405 keys::kInvalidWindowStateError));
410 406
411 #if !defined(USE_AURA)
412 // Disabled for now (crbug.com/105173) because window minimization is not
413 // supported on Aura yet (crbug.com/104571).
414 static const char kArgsMinimizedWithBounds[] = 407 static const char kArgsMinimizedWithBounds[] =
415 "[%u, {\"state\": \"minimized\", \"width\": 500}]"; 408 "[%u, {\"state\": \"minimized\", \"width\": 500}]";
416 EXPECT_TRUE(MatchPattern( 409 EXPECT_TRUE(MatchPattern(
417 RunFunctionAndReturnError( 410 RunFunctionAndReturnError(
418 new UpdateWindowFunction(), 411 new UpdateWindowFunction(),
419 base::StringPrintf(kArgsMinimizedWithBounds, window_id), 412 base::StringPrintf(kArgsMinimizedWithBounds, window_id),
420 browser()), 413 browser()),
421 keys::kInvalidWindowStateError)); 414 keys::kInvalidWindowStateError));
422 #endif
423 415
424 static const char kArgsMaximizedWithBounds[] = 416 static const char kArgsMaximizedWithBounds[] =
425 "[%u, {\"state\": \"maximized\", \"width\": 500}]"; 417 "[%u, {\"state\": \"maximized\", \"width\": 500}]";
426 EXPECT_TRUE(MatchPattern( 418 EXPECT_TRUE(MatchPattern(
427 RunFunctionAndReturnError( 419 RunFunctionAndReturnError(
428 new UpdateWindowFunction(), 420 new UpdateWindowFunction(),
429 base::StringPrintf(kArgsMaximizedWithBounds, window_id), 421 base::StringPrintf(kArgsMaximizedWithBounds, window_id),
430 browser()), 422 browser()),
431 keys::kInvalidWindowStateError)); 423 keys::kInvalidWindowStateError));
432 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698